-
Notifications
You must be signed in to change notification settings - Fork 35
API migration tips & tricks
Luna McNulty edited this page Oct 30, 2024
·
2 revisions
npm run start:memory-mongo
GATSBY_FUNCTIONS_PLATFORM=darwin GATSBY_FUNCTIONS_ARCH=arm64 gatsby build
npm run start
Obsolete: npm run serve
To reduce crashes:
NODE_OPTIONS=--max-old-space-size=18192 npm run start
This will help you to:
- write queries/mutations with suggestions
- debug API fields
npm run start:api
Possible Errors
If you get an error like:
Error: Cannot find module '/<long path>/site/gatsby-site/ts-node/register'
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
You may need to create a symlink to ts-node
cd site/gatsby-site/
ln -s ./node_modules/ts-node ts-node
npm run test:api
npm run codegen
If using vscode it is highly recommended to install: