Redeploys failing

I am trying to deploy. The build succeeded on the preview branch, but the build on the production branch (of the same commit) failed.

The error is

Module not found: Can’t resolve ‘@sentry/utils’

I have tried making minor changes to force a rebuild and the result is the same.

Are there issues with the pipeline currently?

Hey @tooom. I hope this issue isn’t happening anymore. But if it is, please tell us more about your project. It would be good to know more about the dependencies, framework, build settings, etc.

There are not currently any known issues: https://www.vercel-status.com/

I have seen this issue before and the support team said it was an upstream error. The error was never resolved, and I was only able to build again once I deleted the project and recreated it (with the same repo and settings).

framework:
next.js 13.5.4

build settings:

dependencies:

“dependencies”: {
@googleapis/pagespeedonline”: “^1.1.5”,
@headlessui/react”: “^1.7.14”,
@headlessui/tailwindcss”: “^0.2.0”,
@heroicons/react”: “^2.0.18”,
@hubspot/api-client”: “^11.1.0”,
@logtail/node”: “^0.4.21”,
@logtail/pino”: “^0.4.22”,
@microlink/react-json-view”: “^1.23.4”,
@next/third-parties”: “^14.1.4”,
@sentry/nextjs”: “^8.30.0”,
@supabase/auth-helpers-nextjs”: “^0.8.7”,
@supabase/supabase-js”: “^2.45.0”,
@types/node”: “20.4.2”,
@types/react”: “^18.2.21”,
@types/react-dom”: “18.2.7”,
“clsx”: “^1.2.1”,
“common-lib”: “file:…/common-lib”,
“cookies-next”: “^4.0.0”,
“cssnano”: “^6.0.1”,
“dataforseo-client”: “^1.0.16”,
“date-fns”: “^3.6.0”,
“deep-eql”: “^4.1.3”,
“encoding”: “^0.1.13”,
“eslint”: “8.44.0”,
“eslint-config-next”: “13.4.10”,
“eslint-plugin-import”: “^2.28.1”,
“gray-matter”: “^4.0.3”,
“heroicons”: “^2.0.18”,
“http-status-codes”: “^2.3.0”,
“next”: “^13.5.4”,
“next-compose-plugins”: “^2.2.1”,
“next-nprogress-bar”: “^2.1.2”,
“nextjs-progressbar”: “^0.0.16”,
“node-html-parser”: “^6.1.6”,
“npm”: “^10.2.4”,
“openai”: “^4.55.3”,
“pino”: “^9.2.0”,
“pino-pretty”: “^11.2.1”,
“posthog-js”: “^1.161.5”,
“posthog-node”: “^4.2.0”,
“react”: “18.2.0”,
“react-dom”: “18.2.0”,
“react-loader-spinner”: “^5.3.4”,
“react-markdown”: “^9.0.1”,
“replicate”: “^0.27.1”,
“schema-dts”: “^1.1.2”,
“semver”: “^7.5.4”,
“server-only”: “^0.0.1”,
“stripe”: “^16.9.0”,
“typescript”: “5.1.6”,
“update”: “^0.7.4”,
“web-lib”: “file:…/web-lib”,
“webflow-api”: “^2.4.2”,
“webflow-icons”: “file:…/webflow-icons”,
“zod”: “^3.23.8”
},

Thanks for sharing that.

The build & dev settings shouldn’t be a problem since they’re the framework default. But it could be a build cache issue. Does it make a difference if you toggle the setting to use or not use the existing Build Cache?

There are a few other ways to disable it listed here: Troubleshooting Build Errors

If you haven’t already tried it, the deploying from CLI is often a good workaround to get you unstuck until we figure out what’s going wrong.

The issue persists after checking or unchecking “Use existing Build Cache”.

Building locally and deploying that build with the CLI does deploy successfully.

How can we get the builds working again in Vercel?

Thanks for giving it a try. I’m glad to hear we at least found a workaround.

If you can share the project name, id, or a deployment link, that will let me dig into the logs for more details.

Great, here’s the project ID: prj_xiccU1lMgRT6iD9fFlViLJ3is8ZH

Thanks for sharing that. It looks like you also opened a ticket and worked with one of our engineers to find the cause and some solution options. In case it helps anyone else, I want to also share those options here.

Since the error message “Module not found: Can’t resolve ‘@sentry/utils’” indicated that the ‘@sentry/utils’ module was missing from project dependencies, it was determined that a missing dependency or package deprecation was the cause. That led to a couple of options to fix the error.

Local option

  1. Install @sentry/utils:
    Use one of the following commands:
    • pnpm add -D @sentry/utils
    • npm install --save @sentry/nextjs
  2. Reinstall Dependencies:
    • Remove the existing node_modules folder using rm -rf node_modules.
    • Reinstall the dependencies with either pnpm install or npm install.

Build command option

Update the package.json file to install the specific Sentry dependency directly.

{
  "scripts": {
    "postinstall": "npm install --save @sentry/nextjs"
  }
}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.