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
install @sentry/integrations:7.1.6.0, apply CaptureConsoleIntegration in both sentry.client.config.js and sentry.server.config.js
extract sentry.base.config.js from 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 to next 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)
Hi, thanks for reporting this! I tried reproducing this by putting a .json file in the pages directory and importing it from within a page - sadly that did not produce the error you shared. Are you using additional plugins that somehow process JSON files?
Actually, nevermind. I might have figured out what the problem is. I think we're matching whatever.js which happens to be a substring of whatever.json 🤦
Is there an existing issue for this?
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
@sentry/integrations:7.1.6.0
, applyCaptureConsoleIntegration
in bothsentry.client.config.js
andsentry.server.config.js
sentry.base.config.js
from 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)yarn build
(which delegates tonext build
)Expected Result
Actual Result
build error
proxyLoader.js
fails to process a JSON file place inpages/
. excerpt from the log:workaround
place JSON file in custom directory
src/config
full log: 20221021_build.log
The text was updated successfully, but these errors were encountered: