You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the Sentry SDK wizard to install Sentry for our Next.js application.
npx @sentry/wizard@latest -i nextjs
After following all the steps and it seemed to be working in development, when running npm run build for Next.js application the build step would fail because it couldn't resolve package hoist-non-react-statics
I'm not sure why this dependency needs to be installed manually in order for the build to succeed... and why it wasn't a dependency for the npm package. "@sentry/nextjs": "^8.24.0",
How are you getting stuck?
Build step failing in CI log
Run npm ci
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Use your platform's native DOMException insteadnpm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
> prepare
> husky ||true
HUSKY=0 skip install
added 2341 packages, and audited 2547 packages in 1m
326 packages are looking for funding
run `npm fund`for details
3 vulnerabilities (1 moderate, 2 high)
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit`for details.
> @powers/[email protected] build
> tsc
>[email protected] build
> prisma generate && NODE_ENV=production next build
Prisma schema loaded from prisma/schema.prisma
✔ Generated Prisma Client (v5.18.0) to ./../node_modules/@prisma/client in 296ms
Start by importing your Prisma Client (See: http://pris.ly/d/importing-client)
Tip: Interested in query caching in just a few lines of code? Try Accelerate today! https://pris.ly/tip-3-accelerate
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.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:
https://nextjs.org/telemetry
▲ Next.js 14.2.5
- Experiments (use with caution):
· instrumentationHook
Creating an optimized production build ...
[@sentry/nextjs - Node.js] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Node.js] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Node.js] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set`options.telemetry` to `false`.
[@sentry/nextjs - Edge] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Edge] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Edge] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set`options.telemetry` to `false`.
[@sentry/nextjs - Client] Warning: No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Client] Warning: No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
[@sentry/nextjs - Client] Info: Sending telemetry data on issues and performance to Sentry. To disable telemetry, set`options.telemetry` to `false`.
Failed to compile.
../node_modules/@sentry/react/build/esm/errorboundary.js:3:1
Module not found: Can't resolve 'hoist-non-react-statics'https://nextjs.org/docs/messages/module-not-foundImport trace for requested module:../node_modules/@sentry/react/build/esm/index.js./node_modules/@sentry/nextjs/build/esm/index.client.js./app/global-error.tsx../node_modules/@sentry/react/build/esm/profiler.js:4:1Module not found: Can't resolve 'hoist-non-react-statics'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
../node_modules/@sentry/react/build/esm/index.js
./node_modules/@sentry/nextjs/build/esm/index.client.js
./app/global-error.tsx
../node_modules/@sentry/react/build/esm/reactrouter.js:3:1
Module not found: Can't resolve 'hoist-non-react-statics'https://nextjs.org/docs/messages/module-not-foundImport trace for requested module:../node_modules/@sentry/react/build/esm/index.js./node_modules/@sentry/nextjs/build/esm/index.client.js./app/global-error.tsx../node_modules/@sentry/react/build/esm/reactrouterv6.js:4:1Module not found: Can't resolve 'hoist-non-react-statics'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
../node_modules/@sentry/react/build/esm/index.js
./node_modules/@sentry/nextjs/build/esm/index.client.js
./app/global-error.tsx
../node_modules/@sentry/react/build/esm/errorboundary.js:3:1
Module not found: Can't resolve 'hoist-non-react-statics'https://nextjs.org/docs/messages/module-not-foundImport trace for requested module:../node_modules/@sentry/react/build/esm/index.js./node_modules/@sentry/nextjs/build/esm/index.client.js./sentry.client.config.ts> Build failed because of webpack errorsnpm error Lifecycle script `build` failed with error:npm error code 1npm error path /home/runner/work/powers/powers/nextnpm error workspace [email protected]npm error location /home/runner/work/powers/powers/nextnpm error command failednpm error command sh -c prisma generate && NODE_ENV=production next build
Hello, this doesn't seem to be an issue outside of a monorepo when creating a fresh nextjs app and using our wizard. Could you please provide a reproduction repo or a stackblitz?
Hello, this doesn't seem to be an issue outside of a monorepo when creating a fresh nextjs app and using our wizard. Could you please provide a reproduction repo or a stackblitz?
While I was working on creating a reproduction repo this error disappeared. I removed node_modules and package-lock.json from all the repos in the monorepo and did a fresh npm install and now it's building correctly without the need for that package in next project. Thanks.
Environment
SaaS (https://sentry.io/)
What are you trying to accomplish?
I used the Sentry SDK wizard to install Sentry for our Next.js application.
npx @sentry/wizard@latest -i nextjs
After following all the steps and it seemed to be working in development, when running
npm run build
for Next.js application the build step would fail because it couldn't resolve packagehoist-non-react-statics
I'm not sure why this dependency needs to be installed manually in order for the build to succeed... and why it wasn't a dependency for the npm package.
"@sentry/nextjs": "^8.24.0",
How are you getting stuck?
Build step failing in CI log
We're using a monorepo with npm workspaces
root monorepo dir package.json
root_dir/next
package.json
After adding ' "hoist-non-react-statics": "^3.3.2",` to dependencies the build will succeed
Using Next.js 14.2.5
Where in the product are you?
Unknown
Link
No response
DSN
No response
Version
No response
The text was updated successfully, but these errors were encountered: