Hi folks, Any help will be appreciated.
Aug 8, 09:44:54 PM: {"level":50,"time":1659951894380,"pid":9,"hostname":"169.254.166.241","name":"graphql-server","msg":"Error building context. Error: Exception in getAuthenticationContext: Cannot find module './ClerkBackendApi'\nRequire stack:\n- /var/task/node_modules/@clerk/backend-core/dist/cjs/api/index.js\n- /var/task/node_modules/@clerk/backend-core/dist/cjs/index.js\n- /var/task/node_modules/@clerk/clerk-sdk-node/dist/Clerk.js\n- /var/task/node_modules/@clerk/clerk-sdk-node/dist/instance.js\n- /var/task/node_modules/@clerk/clerk-sdk-node/instance.js\n- /var/task/node_modules/@redwoodjs/api/dist/auth/decoders/clerk.js\n- /var/task/node_modules/@redwoodjs/api/dist/auth/decoders/index.js\n- /var/task/node_modules/@redwoodjs/api/dist/auth/index.js\n- /var/task/node_modules/@redwoodjs/api/dist/index.js\n- /var/task/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js\n- /var/task/node_modules/@redwoodjs/graphql-server/dist/index.js\n- /var/task/api/dist/functions/graphql.js\n- /var/task/graphql.js\n- /var/runtime/index.mjs"}
Here’s my Netlify.toml
[build]
command = "yarn ci:build && yarn ci:migrate"
publish = "web/dist"
functions = "api/dist/functions"
[dev]
# To use [Netlify Dev](https://www.netlify.com/products/dev/),
# install netlify-cli from https://docs.netlify.com/cli/get-started/#installation
# and then use netlify link https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
# to connect your local project to a site already on Netlify
# then run netlify dev and our app will be accessible on the port specified below
framework = "redwoodjs"
# Set targetPort to the [web] side port as defined in redwood.toml
targetPort = 8910
# Point your browser to this port to access your RedwoodJS app
port = 8888
[[redirects]]
from = "/*"
to = "/200.html"
status = 200
And my scripts
"scripts": {
"ci:build": "yarn rw test && yarn rw build",
"ci:migrate": "bash +x ./scripts/migrateIfRequired.sh"
},
Bash script
if [ -z ${MIGRATE_DATABASE+x} ];
then DATABASE_URL=$MIGRATE_DATABASE yarn rw deploy netlify --no-build;
else echo 'Skipping migration. No $MIGRATE_DATABASE';
fi