Hello - I keep having an error message when trying to deploy my application to Vercel. I’m not sure whats acting up here as I’ve followed the proper documentation but I can assume that its a dependency issue but not sure where. Here’s the error message,
---------- Error rendering path "/" ----------
01:21:49.241 TypeError: Cannot read properties of undefined (reading 'createCell')
01:21:49.241 at Object.createCell (/vercel/path0/node_modules/@redwoodjs/web/dist/index.js:90:24)
01:21:49.241 at Object.<anonymous> (/vercel/path0/node_modules/@redwoodjs/web/dist/components/createCell.js:9:22)
01:21:49.241 at Module._compile (node:internal/modules/cjs/loader:1254:14)
01:21:49.241 at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
01:21:49.241 at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
01:21:49.242 at Object.newLoader [as .js] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
01:21:49.242 at Module.load (node:internal/modules/cjs/loader:1117:32)
01:21:49.242 at Function.Module._load (node:internal/modules/cjs/loader:958:12)
01:21:49.242 at Module.require (node:internal/modules/cjs/loader:1141:19)
01:21:49.242 at require (node:internal/modules/cjs/helpers:110:18)
01:21:49.242 at Object.<anonymous> (/vercel/path0/node_modules/@redwoodjs/web/dist/index.js:129:19)
01:21:49.242 at Module._compile (node:internal/modules/cjs/loader:1254:14)
01:21:49.242 at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
01:21:49.242 at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
01:21:49.242 at Object.newLoader [as .js] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
01:21:49.242 at Module.load (node:internal/modules/cjs/loader:1117:32)
01:21:49.242 at Function.Module._load (node:internal/modules/cjs/loader:958:12)
01:21:49.243 at Module.require (node:internal/modules/cjs/loader:1141:19)
01:21:49.243 at require (node:internal/modules/cjs/helpers:110:18)
01:21:49.243 at Object.<anonymous> (/vercel/path0/web/src/App.tsx:1:1)
01:21:49.243 at Module._compile (node:internal/modules/cjs/loader:1254:14)
01:21:49.243 at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
01:21:49.243 at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
01:21:49.243 at Object.newLoader [as .tsx] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
01:21:49.243 at Module.load (node:internal/modules/cjs/loader:1117:32)
01:21:49.243 at Function.Module._load (node:internal/modules/cjs/loader:958:12)
01:21:49.243 at Module.require (node:internal/modules/cjs/loader:1141:19)
01:21:49.243 at require (node:internal/modules/cjs/helpers:110:18)
01:21:49.244 at /vercel/path0/node_modules/@redwoodjs/prerender/dist/runPrerender.js:247:120
01:21:49.244 at processTicksAndRejections (node:internal/process/task_queues:95:5)
01:21:49.244 at runPrerender (/vercel/path0/node_modules/@redwoodjs/prerender/dist/runPrerender.js:247:7)
01:21:49.244 at Task.task [as taskFn] (/vercel/path0/node_modules/@redwoodjs/cli/dist/commands/prerenderHandler.js:157:35)
01:21:49.244 at Task.run (/vercel/path0/node_modules/listr2/dist/index.cjs:2040:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Command failed with exit code 1: yarn rw prerender
error Command failed with exit code 1.
Error: Command failed with exit code 1: yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up
at makeError (/vercel/path0/node_modules/execa/lib/error.js:60:11)
at handlePromise (/vercel/path0/node_modules/execa/index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
shortMessage: 'Command failed with exit code 1: yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up',
command: 'yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up',
escapedCommand: '"yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn rw deploy vercel" exited with 1
BUILD_UTILS_SPAWN_1: Command "yarn rw deploy vercel" exited with 1
Hey @sergio, it looks like the yarn rw deploy vercel command is failing, which is the command Vercel uses to deploy your project. You can actually run it locally to try and debug. From the error message, It looks like the yarn rw prerender command may have gone wrong, which is one of the commands yarn rw deploy vercel runs.
And if you have a repo or at least a page or component that can’t be built that you could share with us we could help debug further.
hey @dom it just keeps failing but I can’t seem to find a component or page that is having an issue building especially when i run tests. I just ran “vercel logs” command specifically to the failed deployment that I just ran and here are the results,
2023-05-30T16:02:07.256Z webpack 5.83.1 compiled with 2 warnings in 19442 ms
2023-05-30T16:02:07.315Z Creating 200.html...
2023-05-30T16:02:07.316Z [COMPLETED] Building Web...
2023-05-30T16:02:07.316Z Starting prerendering...
2023-05-30T16:02:07.555Z $ /vercel/path0/node_modules/.bin/rw prerender
2023-05-30T16:02:09.439Z ❯ Prerendering / -> web/dist/index.html
2023-05-30T16:02:12.472Z
2023-05-30T16:02:12.472Z You can use `yarn rw prerender --dry-run` to debug
2023-05-30T16:02:12.472Z
2023-05-30T16:02:12.472Z ---------- Error rendering path "/" ----------
2023-05-30T16:02:12.486Z TypeError: Cannot read properties of undefined (reading 'createCell')
2023-05-30T16:02:12.486Z at Object.createCell (/vercel/path0/node_modules/@redwoodjs/web/dist/index.js:90:24)
2023-05-30T16:02:12.486Z at Object.<anonymous> (/vercel/path0/node_modules/@redwoodjs/web/dist/components/createCell.js:9:22)
2023-05-30T16:02:12.486Z at Module._compile (node:internal/modules/cjs/loader:1254:14)
2023-05-30T16:02:12.486Z at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
2023-05-30T16:02:12.486Z at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
2023-05-30T16:02:12.486Z at Object.newLoader [as .js] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
2023-05-30T16:02:12.486Z at Module.load (node:internal/modules/cjs/loader:1117:32)
2023-05-30T16:02:12.486Z at Function.Module._load (node:internal/modules/cjs/loader:958:12)
2023-05-30T16:02:12.487Z at Module.require (node:internal/modules/cjs/loader:1141:19)
2023-05-30T16:02:12.487Z at require (node:internal/modules/cjs/helpers:110:18)
2023-05-30T16:02:12.487Z at Object.<anonymous> (/vercel/path0/node_modules/@redwoodjs/web/dist/index.js:129:19)
2023-05-30T16:02:12.487Z at Module._compile (node:internal/modules/cjs/loader:1254:14)
2023-05-30T16:02:12.487Z at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
2023-05-30T16:02:12.487Z at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
2023-05-30T16:02:12.487Z at Object.newLoader [as .js] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
2023-05-30T16:02:12.487Z at Module.load (node:internal/modules/cjs/loader:1117:32)
2023-05-30T16:02:12.487Z at Function.Module._load (node:internal/modules/cjs/loader:958:12)
2023-05-30T16:02:12.487Z at Module.require (node:internal/modules/cjs/loader:1141:19)
2023-05-30T16:02:12.487Z at require (node:internal/modules/cjs/helpers:110:18)
2023-05-30T16:02:12.487Z at Object.<anonymous> (/vercel/path0/web/src/App.tsx:1:1)
2023-05-30T16:02:12.487Z at Module._compile (node:internal/modules/cjs/loader:1254:14)
2023-05-30T16:02:12.487Z at Module._compile (/vercel/path0/node_modules/pirates/lib/index.js:136:24)
2023-05-30T16:02:12.487Z at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
2023-05-30T16:02:12.488Z at Object.newLoader [as .tsx] (/vercel/path0/node_modules/pirates/lib/index.js:141:7)
2023-05-30T16:02:12.488Z at Module.load (node:internal/modules/cjs/loader:1117:32)
2023-05-30T16:02:12.488Z at Function.Module._load (node:internal/modules/cjs/loader:958:12)
2023-05-30T16:02:12.488Z at Module.require (node:internal/modules/cjs/loader:1141:19)
2023-05-30T16:02:12.488Z at require (node:internal/modules/cjs/helpers:110:18)
2023-05-30T16:02:12.488Z at /vercel/path0/node_modules/@redwoodjs/prerender/dist/runPrerender.js:247:120
2023-05-30T16:02:12.488Z at processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-05-30T16:02:12.488Z at runPrerender (/vercel/path0/node_modules/@redwoodjs/prerender/dist/runPrerender.js:247:7)
2023-05-30T16:02:12.488Z at Task.task [as taskFn] (/vercel/path0/node_modules/@redwoodjs/cli/dist/commands/prerenderHandler.js:157:35)
2023-05-30T16:02:12.488Z at Task.run (/vercel/path0/node_modules/listr2/dist/index.cjs:2040:11)
2023-05-30T16:02:12.489Z ✖ Prerendering / -> web/dist/index.html [FAILED: Failed to render "/vercel/path0/web/src/pages/HomePage/HomePage.tsx"]
2023-05-30T16:02:12.489Z
2023-05-30T16:02:12.489Z
2023-05-30T16:02:12.491Z Running diagnostic checks
2023-05-30T16:02:12.491Z ✔ Diagnostics checks passed
2023-05-30T16:02:12.491Z
2023-05-30T16:02:12.492Z Tips:
2023-05-30T16:02:12.492Z - This could mean that a library you're using does not support SSR.
2023-05-30T16:02:12.492Z - Avoid using `window` in the initial render path through your React components without checks.
2023-05-30T16:02:12.492Z See https://redwoodjs.com/docs/prerender#prerender-utils
2023-05-30T16:02:12.492Z - Avoid prerendering Cells with authenticated queries, by conditionally rendering them.
2023-05-30T16:02:12.492Z See https://redwoodjs.com/docs/prerender#common-warnings--errors
2023-05-30T16:02:12.493Z
2023-05-30T16:02:12.520Z error Command failed with exit code 1.
2023-05-30T16:02:12.520Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-05-30T16:02:12.535Z Command failed with exit code 1: yarn rw prerender
2023-05-30T16:02:12.570Z error Command failed with exit code 1.
2023-05-30T16:02:12.570Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-05-30T16:02:12.588Z rw deploy vercel [...commands]
2023-05-30T16:02:12.588Z
2023-05-30T16:02:12.588Z Build command for Vercel deploy
2023-05-30T16:02:12.588Z
2023-05-30T16:02:12.588Z Options:
2023-05-30T16:02:12.588Z --help Show help [boolean]
2023-05-30T16:02:12.588Z --version Show version number [boolean]
2023-05-30T16:02:12.588Z --cwd Working directory to use (where `redwood.toml` is
2023-05-30T16:02:12.588Z located)
2023-05-30T16:02:12.588Z --build Build for production [boolean] [default: "true"]
2023-05-30T16:02:12.589Z --prisma Apply database migrations [boolean] [default: "true"]
2023-05-30T16:02:12.589Z --data-migrate, --dm Migrate the data in your database
2023-05-30T16:02:12.589Z [boolean] [default: "true"]
2023-05-30T16:02:12.589Z
2023-05-30T16:02:12.589Z For more commands, options, and examples, see Redwood CLI Reference
2023-05-30T16:02:12.589Z (https://redwoodjs.com/docs/cli-commands#deploy)
2023-05-30T16:02:12.589Z
2023-05-30T16:02:12.590Z Error: Command failed with exit code 1: yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up
2023-05-30T16:02:12.591Z at makeError (/vercel/path0/node_modules/execa/lib/error.js:60:11)
2023-05-30T16:02:12.591Z at handlePromise (/vercel/path0/node_modules/execa/index.js:118:26)
2023-05-30T16:02:12.591Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
2023-05-30T16:02:12.591Z shortMessage: 'Command failed with exit code 1: yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up',
2023-05-30T16:02:12.591Z command: 'yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up',
2023-05-30T16:02:12.591Z escapedCommand: '"yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up"',
2023-05-30T16:02:12.591Z exitCode: 1,
2023-05-30T16:02:12.591Z signal: undefined,
2023-05-30T16:02:12.591Z signalDescription: undefined,
2023-05-30T16:02:12.591Z stdout: undefined,
2023-05-30T16:02:12.591Z stderr: undefined,
2023-05-30T16:02:12.591Z failed: true,
2023-05-30T16:02:12.591Z timedOut: false,
2023-05-30T16:02:12.591Z isCanceled: false,
2023-05-30T16:02:12.591Z killed: false
2023-05-30T16:02:12.591Z }
2023-05-30T16:02:12.616Z error Command failed with exit code 1.
2023-05-30T16:02:12.617Z info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-05-30T16:02:12.646Z Error: Command "yarn rw deploy vercel" exited with 1
I also just ran yarn rw prerender --dry-run and here are the results of that,
yarn run v1.22.19
$ simpletenant/mvp/node_modules/.bin/rw prerender --dry-run
::: Dry run, not writing changes :::
✔ Prerendering / -> web/dist/index.html
✨ Done in 3.02s.
Hey @dom i think I found the issue and it was the pre-rendering code that was in the index.html file that wasn’t defined. I removed it from there and the routes file and was able to successfully deploy to Vercel.