I’m running issues when running block release
to deploy my Airtable app.
I’m using npm workspaces as I develop my Custom Airtable App since I’m using a monorepo to make code management and sharing convenient.
Here’s the basic folder structure for my project:
project_root
/
packages/
- houses workspaces
common/
- contains code shared by
airtable_app
andserver
workspaces - package name: @shoptable/common
- contains code shared by
airtable_app/
- contains the airtable block app
server/
- another workspace
Here are the steps I take before running block release
:
npm i
fromproject_root
cd packages/airtable_app
block release
I run into the following error:
building
copying package.json file
copying package-lock.json file
Error: package-lock.json does not exist!
Failed to build the block code!
There’s only a package-lock.json
generated at the project_root
level. How can I get around this issue with my development environment?
Current Workaround
The only way I’ve found that works is to run npm pack
on my @shoptable/common
package and reference it in airtable_app/package.json
's dependencies as such:
{
...
"@shoptable/common": "file:../common/shoptable-common-1.0.0.tgz",
...
}
This isn’t ideal given that during development I’d like to simply refer to the workspace via the version number so as to make sure that I have the latest changes I’m working on.
Is there a better way to run block release
given my monorepo setup?
Other things I’ve tried that didn’t work
In airtable_app/package.json
I’ve tried declaring @shoptable/common
as a local dependency like so:
{
...
"@shoptable/common": "file:../common",
...
}
And then running npm i
from within the airtable_app/
dir. This gets me a little further but I get the following failure after running :
building
copying package.json file
copying package-lock.json file
installing node modules
npm]
>npm] added 164 packages, and audited 166 packages in 2s
anpm]
>npm] 6 packages are looking for funding
gnpm] run `npm fund` for details
`npm]
>npm] found 0 vulnerabilities
transpiling and building frontend bundle
Bundle Error: Cannot find module '@shoptable/common' from '/private/var/folders/1t/rfq1yymx391fmcn0lj_9trm80000gn/T/airtableBlocks/build/1622060082006/transpiled/user/src'
Error: Cannot find module '@shoptable/common' from '/private/var/folders/1t/rfq1yymx391fmcn0lj_9trm80000gn/T/airtableBlocks/build/1622060082006/transpiled/user/src'
Failed to build the block code!