Error building nextjs application on vercel

When building my application on vercel it fails for some reason and i'm not sure why, it builds fine locally but fails on remote. this is the error i'm getting:
Running "bun run build"
$ next build
Next.js 14.2.21
- Experiments (use with caution):
· instrumentationHook
Creating an optimized production build ...
unhandledRejection TypeError: invalid pattern
at assertValidPattern (/vercel/path0/node_modules/minimatch/minimatch.js:275:11)
at new Minimatch (/vercel/path0/node_modules/minimatch/minimatch.js:133:3)
at setopts (/vercel/path0/node_modules/glob/common.js:116:20)
at new Glob (/vercel/path0/node_modules/glob/glob.js:132:3)
at Function.glob (/vercel/path0/node_modules/glob/glob.js:72:10)
at _callee2$ (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:8345:41)
at tryCatch (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:120:17)
at Generator.<anonymous> (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:201:22)
at Generator.next (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:145:21)
at asyncGeneratorStep (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:391:24)
error: script "build" exited with code 1
Error: Command "bun run build" exited with 1
Running "bun run build"
$ next build
Next.js 14.2.21
- Experiments (use with caution):
· instrumentationHook
Creating an optimized production build ...
unhandledRejection TypeError: invalid pattern
at assertValidPattern (/vercel/path0/node_modules/minimatch/minimatch.js:275:11)
at new Minimatch (/vercel/path0/node_modules/minimatch/minimatch.js:133:3)
at setopts (/vercel/path0/node_modules/glob/common.js:116:20)
at new Glob (/vercel/path0/node_modules/glob/glob.js:132:3)
at Function.glob (/vercel/path0/node_modules/glob/glob.js:72:10)
at _callee2$ (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:8345:41)
at tryCatch (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:120:17)
at Generator.<anonymous> (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:201:22)
at Generator.next (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:145:21)
at asyncGeneratorStep (/vercel/path0/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:391:24)
error: script "build" exited with code 1
Error: Command "bun run build" exited with 1
github repo: https://github.com/jacobsamo/BuzzTrip/tree/improve-web
GitHub
GitHub - jacobsamo/BuzzTrip at improve-web
Plan the trip you've always dreamed of. Contribute to jacobsamo/BuzzTrip development by creating an account on GitHub.
Solution:
The issue seemed to be the following: 1. instrumentationHook was not set in nextjs config: ``` experimental: { instrumentationHook: true,...
Jump to solution
3 Replies
xyzmani
xyzmani2w ago
looks like a type error
Jacob
JacobOP2w ago
Yes but no
Solution
Jacob
Jacob2w ago
The issue seemed to be the following: 1. instrumentationHook was not set in nextjs config:
experimental: {
instrumentationHook: true,
},
experimental: {
instrumentationHook: true,
},
2. Incorrect sentry version 3. missing configs

Did you find this page helpful?