-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.16.0
Framework Version
7.16.0
Link to Sentry event
No response
Steps to Reproduce
- install via "getting started" guide
- install
@sentry/integrations:7.1.6.0, applyCaptureConsoleIntegrationin bothsentry.client.config.jsandsentry.server.config.js - extract
sentry.base.config.jsfrom the two config files and import the new file - this is done since both files are fully identical (and probably irrelevant in the context of this bug report) - run
yarn build(which delegates tonext build)
Expected Result
- build succeeds
- non-sentry JSON files are not processed by sentry during the build phase
Actual Result
build error
proxyLoader.jsfails to process a JSON file place in pages/. excerpt from the log:
./src/pages/badges/create/stepNames.json
Module parse failed: Unexpected token "i" (0x69) in JSON at position 0 while parsing near "import * as stepName..."
File was processed with these loaders:
* ./node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js
You may need an additional loader to handle the result of these loaders.
JSONParseError: Unexpected token "i" (0x69) in JSON at position 0 while parsing near "import * as stepName..."
at JsonParser.parse (myproject/node_modules/next/dist/compiled/webpack/bundle5.js:105017:7)
workaround
place JSON file in custom directory src/config
full log: 20221021_build.log
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK