airtable / blocks Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://airtable.com/developers/blocks
Home Page: https://airtable.com/developers/blocks
I have been working on an extension for months now and went in beta since like a month, and for a long time of this period I've been able to use the ExpandRecord() function without issues. Suddenly this week I start noticing that when my extension calls that function for a record from a certain table, then the extension crashes and I get the standard Airtable message "An error has occured - Refresh the page."
This seems like something changed in the blocks SDK causing this issue. Anyone else experiencing this?
When I ran "block run" on my existing project, the command failed with the followin message:
Error: Cannot find module 'C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\lib\commands\run'
Require stack:
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\plugin.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\config.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\index.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\command\lib\command.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\command\lib\index.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\bin\run
Code: MODULE_NOT_FOUND
Block-cli v0.064 can execute without any problem. Please help
I use volta to manage my Node instances, and running into an issue installing this package. No other package is affected.
Here is the log output:
➜ air (2.5.9) npm install -g @airtable/blocks-cli
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/newuser/.volta/tmp/image/packages/.tmpi7RTLM/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/newuser/.volta/tmp/image/packages/.tmpi7RTLM/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/newuser/.npm/_logs/2021-11-27T19_52_58_916Z-debug.log
Hey,
Getting this when calling block run:
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\user1\AppData\Roaming\npm\node_modules\@airtable\blocks-cli\transpiled\src\builder\server\.next\static\chunks\pages\_app.js as it exceeds the max of 500KB.
Hi
I needed to write a custom bundler for my project using webpack 5, babel, antd... In the process I have upgrade the current blocks-cli source code to work with the latest version of nodejs, npm and fix the issues when running rmdirAsync function (blocks-cli/lib/helpers/system_extra.js) which causes block release to hang. The dependencies of blocks-cli are also upgrade using npm-check-updates. The whole source code is attached.
Also I extended the default bundler to work with webpack 5. The webpack config and the custom bundler are attached. Using my custom bundler, I was able to reduce bundle size from 43 Mb to 4.9 Mb.
https://drive.google.com/file/d/1ZInf3OL9sHv9lp-ZeXHnPe6Tg-wEPMQj/view?usp=sharing
webpack_airtable.zip
When I try to run npm install -g @airtable/blocks-cli
I get ERR! Cannot read property 'split' of null
error.
I am running node v14.16.1 and I am on a Mac. Here is where the error occurred in my debug log. Let me know what else I can provide to be helpful. Thanks.
4557 timing metavuln:cache:get:security-advisory:@airtable/blocks-cli:C/VB8CBFYps5hrxkx+bDeYa+ffIErGhYkhstwHUZHTBCGKjnpC6rPfK8BmDaGzjLMiSFCtFVyGpG3jhDR9+7yQ== Completed in 0ms
4558 verbose stack TypeError: Cannot read property 'split' of null
I am using the Block API and noticed that the FieldType 'MULTIPLE_RECORD_LINKS' doesn't provide information about the relationship option (whether it allows linking to only a single foreign record or multiple records). This information can be quite important to handle the foreign key field differently.
There's also not a 'SINGLE_RECORD_LINK' FieldType either (which would be more ideal actually).
Is that a known issue, or there's anywhere I can get that information through the Block API?
It has become easier to add external dependencies to custom apps, and that is great. However it has been limited by the version of React below 17. I am using npm v8.6.0, and it npm install fails due to peer dependency conflict when installing a module that depends on higher version of React. If I run it with --legacy-peer-deps, it looks like it worked, but then when I run block run, I get an error that blocks-cli cannot be found.
The Airtable team hasn't commented on a single issue since the earliest open issue, which was opened in July 2020.
Could we get some updates? What's the team's process here?
Version: "@airtable/blocks": "^1.11.1"
When using the CellRenderer component, we noticed that it is cropping the value of the record at around 500 characters.
To reproduce, you can use the CellRenderer with a long enough text.
<CellRenderer
field={f}
cellValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla erat ex, ultrices at erat non, aliquam dictum mauris.
Nullam id libero nec nunc dapibus tempor ac id mauris. Fusce sed enim nec lacus tempus vulputate ut eget massa. Sed in
lorem rutrum, congue nibh eu, semper erat. Vivamus blandit posuere pulvinar. Ut aliquam sapien eget odio vehicula, ut
accumsan quam ullamcorper. Pellentesque non eleifend mi. Curabitur risus erat, accumsan blandit placerat id, cursus nec
tortor. In at viverra quam, eu dignissim nisi. In interdum iaculis ex, malesuada suscipit nisi malesuada et. Nulla placerat sit
amet mauris quis suscipit. Sed eleifend hendrerit nibh a cursus."/>
Same behaviour if instead of cellValue
we use record={r}
I have a local svg file, but I can't load it. I'm getting this error:
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Is it possible to add an svg loader to the webpack runtime?
I'm trying to run an application using airtable tutorial, however once I run block run
this error appears:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
Since we don't have control over the webpack configuration for this, how can we fix it?
Hi, I found a few references to this file https://github.com/Airtable/blocks/blob/master/packages/sdk/docs/guide_writes.md but it 404s.
I'm also not sure if you meant to link to https://airtable.com/developers/apps/guides/write-back-to-airtable, but if that's the one I can send a PR fixing this linking issue.
thank you
aria in "airaLabel" is misspelled
Hey,
In part 3, you have a call to globalConfig.set instead of globalConfig.setAsync
Ronen
Please consider upgrading the minimum browser targets or maybe using browserslist
at https://github.com/Airtable/blocks/blob/master/packages/webpack-bundler/src/javascript_config.ts#L5
In my case the latest version of Mapbox GL (v2.6) now includes an object spread operator in the build. Object spread needs Firefox 55, but the CLI is targeting >52 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#browser_compatibility Firefox v52 is from 2017?
Alternatively, an option to skip transpilation of specific modules would also work. I tried the Webpack '!' exclude before the module name but that isn't working in this setup.
Alternatively an option to include specific modules for transpilation would work (had that backwards) I think the issue is that babel-loader expects the imports to either be compatible with the target or included for transpilation.
I tried to release my block after having installed dependencies locally with yarn and got the following:
% block release
building
copying package.json file
copying package-lock.json file
❌ Error: package-lock.json does not exist!
Failed to build the block code!
This is using block v0.0.55
.
Related, is the code for the CLI itself available on Github? It doesn't seem to be in this repo.
blocks/packages/sdk/src/ui/link.tsx
Line 145 in 717abb7
Here, children can be marked optional. Applies to the scenario in screenshot below
(No issues building, but TS Lint errors in IDE)
In the default youtube example, useLoadable
used as follows:
I'm getting a TS error:
The useLoadable
source seems to show that the second param should indeed be an object
, not a string[]
:
blocks/packages/sdk/src/ui/use_loadable.ts
Lines 112 to 114 in 7c1ead6
Hi, could we also have onKeyPress as a prop for the Input component? Thanks!
This is currently required by the blocks cli for testing Airtable extensions locally.
In case anyone has same issue (mac):
npm root -g
cd @airtable/blocks-cli/keys/
remove -rf server.*
openssl req -newkey rsa:2048 -x509 -nodes -keyout server.key -new -out server.crt -subj /CN=localhost -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:localhost')) -sha256 -days 3650
add SSL from your web browsers to key chain
airtable/blocks-cli
only works with node v14, which is now in maintenance mode.
The current recommended version is v16:
https://nodejs.org/en/about/releases/
I'd like to build an app on the Airtable marketplace (to support ML inference), but cannot downgrade other packages that depend on node v16 to make this happen.
Would it be possible to work on node v16 support?
BTW here's the error message when installing it on node v16:
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! Cannot read property 'split' of null
Maybe upgrading some of these packages would be enough to get v16 support.
On this page
https://airtable.com/developers/blocks/api/UI/components/Icon
looks like the link to * list of supported icons* is broken
looks like URL goes to https://airtable.com/developers/blocks/packages/sdk/docs/icons.md
but it reloads the index page (https://airtable.com/developers/blocks
)
Hey,
So when using typescript declare on a class member, I get the following unrelated flow error:
The 'declare' modifier is only allowed when the 'allowDeclareFields' option of @babel/plugin-transform-flow-strip-types or @babel/preset-flow is enabled.
Code to reproduce:
class Base {
prop1: string | number = 0;
}
class Derived extends Base {
declare prop1: string;
}
I'm trying to rely on viewport.isFullScreen (Im using useViewport()
to get viewport)
It seems to always return false even when I'm in fullscreen mode.
my code:
const viewport = useViewport(); output to screen: {viewport.isFullScreen ? 'YES' : 'NO'}
see my explainer video: https://www.loom.com/share/459cd985f7404b9ea9778d88c1efa551
Hi, I’m using block sdk to build a custom app. But I meet an error after I install an modules @antv/x6
(repo)
Bundle Error: 'import' and 'export' may appear only with 'sourceType: module'
I have checked the antv/x6
module has a es5 version in the /lib
directory. And I try to import this modules use code below
import { Graph } from '@antv/x6/lib';
But still show the bundle error
It'd be great if we could import WebAssembly files in Airtable Apps by default.
Currently, there's no way of overwriting the Webpack config that the block
CLI uses, and WebAssembly imports need to be enabled by setting the asyncWebAssembly
and syncWebAssembly
experimental flags to true (see here https://webpack.js.org/configuration/experiments/). One could build a custom bundler, but that is currently a lot of work and mostly doesn't work.
The changes to do this are minimal, probably just need to add the lines
experiments: {
asyncWebAssembly: true,
syncWebAssembly: true,
},
};
to the createWebpackCompilerConfig
function in this file: https://github.com/Airtable/blocks/blob/master/packages/cli-next/src/bundler/webpack_config.ts. I can put up a pull request, but my guess is that this needs to be looked over carefully by and Airtable engineer anyway...
P.S.: The use case I have is running a high-speed cohort-matching algorithm for a large-scale cohort-based virtual program.
Hello,
I'm looking into setting up airtable as a CMS for react native for my company. Looks like this would require modifying the blocks sdk to have an import for react-native-web, also possibly editing the babel config for blocks per the docs
I tried to do this in a fork to submit a PR but was unable to because of internal dependencies in a few places.
Is there any suggested approaches for enabling rn-web for blocks for the airtable sdk? Or is this something that you guys would be interested in providing support for out of the box? Looks like might only require a few lines of code on your side
Thanks!
When using a custom template repo, the init
command assumes that there is a master
branch for the template repo. The default branch for new Github repos is main
. May I suggest adding a new --template-branch
command so you can override this?
@airtable/blocks
version 1.5.1
Whenever I try to run Base.createTableAsync
with a field config for a MULTIPLE_RECORD_LINKS
field I run into the following error:
In the field options for the MULTIPLE_RECORD_LINKS
field I've made sure that the linkedTableId
refers to a table that exists.
I've created a repo that reproduces the issue.
Current workaround: Usingtable.createFieldAsync
to create a MULTIPLE_RECORD_LINKS field works but nothing on the documentation suggests that I shouldn't also be able to do this via Base.createTableAsync
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.