commerce: Sitemap.xml prerendering error on all preview deployments to Vercel

When pushing any branch except main, I get the following error on preview deployments to Vercel:

Error occurred prerendering page "/sitemap.xml". Read more: https://nextjs.org/docs/messages/prerender-error

This occurs on branches with identical code to the main branch, ones that I created from main and push immediately with no code modifications. The following is a screenshot of my deployments:

Screenshot 2023-05-09 at 3 29 54 PM

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 20 (2 by maintainers)

Most upvoted comments

In my case I forgot to add the .myshopify.com part in the SHOPIFY_STORE_DOMAIN variable and got the same error.

same error here. runs fine locally, but fails vercel deployment.

[18:08:05.609] Running build in Cleveland, USA (East) – cle1
[18:08:05.656] Cloning github.com/twilio-jyoung/nextjs-commerce (Branch: main, Commit: 4dadbfc)
[18:08:05.661] Skipping build cache, deployment was triggered without cache.
[18:08:06.231] Cloning completed: 574.503ms
[18:08:06.382] Running "vercel build"
[18:08:06.861] Vercel CLI 30.2.1
[18:08:07.096] Warning: Detected "engines": { "node": ">=16" } in your `package.json` that will automatically upgrade when a new major Node.js Version is released. Learn More: http://vercel.link/node-version
[18:08:07.122] Detected `pnpm-lock.yaml` version 6 generated by pnpm 8...
[18:08:07.142] Installing dependencies...
[18:08:07.651] Lockfile is up to date, resolution step is skipped
[18:08:07.675] Progress: resolved 1, reused 0, downloaded 0, added 0
[18:08:07.750] Packages: +472
[18:08:07.750] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[18:08:08.025] Packages are hard linked from the content-addressable store to the virtual store.
[18:08:08.025]   Content-addressable store is at: /vercel/.local/share/pnpm/store/v3
[18:08:08.025]   Virtual store is at:             node_modules/.pnpm
[18:08:08.679] Progress: resolved 472, reused 0, downloaded 39, added 39
[18:08:09.680] Progress: resolved 472, reused 0, downloaded 129, added 127
[18:08:10.691] Progress: resolved 472, reused 0, downloaded 265, added 259
[18:08:11.692] Progress: resolved 472, reused 0, downloaded 401, added 394
[18:08:12.692] Progress: resolved 472, reused 0, downloaded 467, added 467
[18:08:13.692] Progress: resolved 472, reused 0, downloaded 469, added 469
[18:08:14.909] Progress: resolved 472, reused 0, downloaded 470, added 470
[18:08:15.912] Progress: resolved 472, reused 0, downloaded 472, added 472, done
[18:08:15.996] .../node_modules/@vercel/git-hooks install$ node ./install.js
[18:08:16.047] .../node_modules/@vercel/git-hooks install: △  @vercel/git-hooks: installing base hook to /vercel/path0/.git/hooks
[18:08:16.048] .../node_modules/@vercel/git-hooks install: △  @vercel/git-hooks: hooks installed successfully
[18:08:16.051] .../node_modules/@vercel/git-hooks install: Done
[18:08:16.166] 
[18:08:16.166] dependencies:
[18:08:16.166] + @headlessui/react 1.7.14
[18:08:16.166] + @vercel/og 0.5.4
[18:08:16.166] + clsx 1.2.1
[18:08:16.166] + framer-motion 10.12.8
[18:08:16.167] + is-empty-iterable 3.0.0
[18:08:16.167] + next 13.4.2
[18:08:16.167] + react 18.2.0
[18:08:16.167] + react-cookie 4.1.1
[18:08:16.167] + react-dom 18.2.0
[18:08:16.167] 
[18:08:16.167] devDependencies:
[18:08:16.167] + @playwright/test 1.33.0
[18:08:16.167] + @tailwindcss/typography 0.5.9
[18:08:16.167] + @types/node 20.1.0
[18:08:16.167] + @types/react 18.2.6
[18:08:16.167] + @types/react-dom 18.2.4
[18:08:16.167] + @vercel/git-hooks 1.0.0
[18:08:16.167] + autoprefixer 10.4.14
[18:08:16.168] + eslint 8.40.0
[18:08:16.168] + eslint-config-next 13.4.1
[18:08:16.168] + eslint-config-prettier 8.8.0
[18:08:16.168] + eslint-plugin-unicorn 47.0.0
[18:08:16.168] + lint-staged 13.2.2
[18:08:16.168] + postcss 8.4.23
[18:08:16.168] + prettier 2.8.8
[18:08:16.168] + prettier-plugin-tailwindcss 0.2.8
[18:08:16.168] + tailwindcss 3.3.2
[18:08:16.168] + typescript 5.0.4
[18:08:16.168] 
[18:08:16.168] Done in 8.9s
[18:08:16.204] Detected Next.js version: 13.4.2
[18:08:16.212] Running "pnpm run build"
[18:08:16.675] 
[18:08:16.676] > @ build /vercel/path0
[18:08:16.676] > next build
[18:08:16.676] 
[18:08:17.058] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[18:08:17.058] This information is used to shape Next.js' roadmap and prioritize features.
[18:08:17.058] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[18:08:17.059] https://nextjs.org/telemetry
[18:08:17.059] 
[18:08:17.147] - info Creating an optimized production build...
[18:08:38.324] - info Compiled successfully
[18:08:38.332] - info Skipping linting
[18:08:38.332] - info Checking validity of types...
[18:08:42.082] - info Collecting page data...
[18:08:52.908] - info Generating static pages (0/6)
[18:08:52.938] - info Generating static pages (1/6)
[18:08:52.948] - info Generating static pages (2/6)
[18:08:52.983] - info Generating static pages (4/6)
[18:08:52.991] 
[18:08:52.991] Error occurred prerendering page "/sitemap.xml". Read more: https://nextjs.org/docs/messages/prerender-error
[18:08:52.991] [object Object]
[18:08:52.992] - info Generating static pages (6/6)
[18:08:52.994] 
[18:08:52.994] > Export encountered errors on following paths:
[18:08:52.994] 	/sitemap.xml/route: /sitemap.xml
[18:08:53.039]  ELIFECYCLE  Command failed with exit code 1.
[18:08:53.060] Error: Command "pnpm run build" exited with 1
[18:08:53.435] BUILD_UTILS_SPAWN_1: Command "pnpm run build" exited with 1