- Install and build
npm ci
# Set `rootDirectory` to `"apps/next-js-project"` in the Vercel UI and pull the settings down
npx vercel pull
NEXT_REPRO_TRACINGROOT=1 npx vercel build
-
Note that the
.vercel/output
does not includes some but not all of the correctnode_modules
to boot the functions on Vercel -
Deploy
npx vercel deploy --prebuilt
- View the preview URL
- Navigate to xxx.vercel.app/test
- Look at the errors in the Vercel function logs
Cannot find module './initialize-require-hook'
Require stack:
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/apps/public/blue-origin-next-js/___next_launcher.cjs
Did you forget to add it to "dependencies" in `package.json`?
RequestId: 768ef631-d772-4ce0-b447-b7aa8705cbac Error: Runtime exited with error: exit status 1
Runtime.ExitError
- Install and build
npm ci
npx vercel build --cwd "apps/next-js-project"
# OR
NEXT_REPRO_TURBOTRACE=1 npx vercel build --cwd "apps/next-js-project"
# OR
NEXT_REPRO_TRACINGROOT=1 npx vercel build --cwd "apps/next-js-project"
# This also has another error during build
-
Note that the
.vercel/output
does not include the correctnode_modules
to boot the functions on Vercel -
Deploy
npx vercel deploy --prebuilt --cwd "apps/next-js-project"
- View the preview URL
- Navigate to xxx.vercel.app/test
- Look at the errors in the Vercel function logs
Cannot find module 'next/dist/server/next-server.js'
Require stack:
- /var/task/___next_launcher.cjs
Did you forget to add it to "dependencies" in `package.json`?
RequestId: fd4f3135-a697-45fe-891a-c0dcd86a9ff8 Error: Runtime exited with error: exit status 1
Runtime.ExitError
OR
Cannot find module './initialize-require-hook'
Require stack:
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/apps/public/blue-origin-next-js/___next_launcher.cjs
Did you forget to add it to "dependencies" in `package.json`?
RequestId: 768ef631-d772-4ce0-b447-b7aa8705cbac Error: Runtime exited with error: exit status 1
Runtime.ExitError