Runs local dev fine, function error when deployed to Netlify
See the error here: https://gameonornot.com Function logs say:
Repo: https://bitbucket.org/r2-creative/gameonornot/src/main/ Any thoughts?
Oct 19, 04:48:54 AM: c5565cd6 [ERROR] [1666176534418] LAMBDA_RUNTIME Failed to get next invocation. Http Response code: 403Oct 19, 04:48:54 AM: c5565cd6 2022-10-19T10:48:54.827Z undefined ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Dynamic require of \"events\" is not supported","reason":{"errorType":"Error","errorMessage":"Dynamic require of \"events\" is not supported","stack":["Error: Dynamic require of \"events\" is not supported"," at file:///var/task/app/.netlify/functions-internal/render.mjs:29:9"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/utils.js (file:///var/task/app/.netlify/functions-internal/render.mjs:5950:41)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/WebSocketServer.js (file:///var/task/app/.netlify/functions-internal/render.mjs:7457:18)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/websocket.js (file:///var/task/app/.netlify/functions-internal/render.mjs:8445:17)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/index.js (file:///var/task/app/.netlify/functions-internal/render.mjs:8461:22)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/@supabase+realtime-
Oct 19, 04:48:54 AM: c5565cd6 [ERROR] [1666176534418] LAMBDA_RUNTIME Failed to get next invocation. Http Response code: 403Oct 19, 04:48:54 AM: c5565cd6 2022-10-19T10:48:54.827Z undefined ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Dynamic require of \"events\" is not supported","reason":{"errorType":"Error","errorMessage":"Dynamic require of \"events\" is not supported","stack":["Error: Dynamic require of \"events\" is not supported"," at file:///var/task/app/.netlify/functions-internal/render.mjs:29:9"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/utils.js (file:///var/task/app/.netlify/functions-internal/render.mjs:5950:41)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/WebSocketServer.js (file:///var/task/app/.netlify/functions-internal/render.mjs:7457:18)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/lib/websocket.js (file:///var/task/app/.netlify/functions-internal/render.mjs:8445:17)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/websocket@1.0.34/node_modules/websocket/index.js (file:///var/task/app/.netlify/functions-internal/render.mjs:8461:22)"," at __require2 (file:///var/task/app/.netlify/functions-internal/render.mjs:47:50)"," at node_modules/.pnpm/@supabase+realtime-

1 Reply
Found the problem, my
Think I had just copy-pasted it from another project. Anyway, all good.
/app
directory had a netlify.toml
that evidently misdirected Netlify. Removing it from the repo solved the error. Its contents were
[build]
command = "npm run build"
publish = "build"
[dev]
command = "svelte-kit dev"
[functions]
directory = "app/netlify/functions"
node_bundler = "esbuild"
[build]
command = "npm run build"
publish = "build"
[dev]
command = "svelte-kit dev"
[functions]
directory = "app/netlify/functions"
node_bundler = "esbuild"