Next.js auto wrappers are creating wildcard exports and crashing builds
See original GitHub issueEnvironment
SaaS (https://sentry.io/)
Version
7.17.1
Steps to Reproduce
sentry.client.config.js
& sentry.server.config.js
=> code:
import * as Sentry from '@sentry/nextjs'
if (process.env.SENTRY_DSN) {
Sentry.init({
dsn: process.env.SENTRY_DSN,
// enabled: process.env.NODE_ENV !== 'test',
environment: 'production',
// release: process.env.NEXT_PUBLIC_APP_VERSION_RELEASE, // Uses the environment variable `SENTRY_RELEASE`, which is also attached to the source maps
// debug: process.env.NODE_ENV === 'development', // You'll need to configure "debug" in sentry.x.config.js files as well as next.config.js
tracesSampleRate: 1.0,
})
}
next.config.js
=> Code:
/** @type {import('next').NextConfig} */
const { withSentryConfig } = require('@sentry/nextjs')
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
env: {
SENTRY_DSN: process.env.NEXT_PUBLIC_SENTRY_DSN,
},
sentry: {
// Use `hidden-source-map` rather than `source-map` as the Webpack `devtool`
// for client-side builds. (This will be the default starting in
// `@sentry/nextjs` version 8.0.0.) See
// https://webpack.js.org/configuration/devtool/ and
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map
// for more information.
hideSourceMaps: true,
},
}
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(nextConfig, {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
})
Expected Result
no error should throw if the App is working properly
Actual Result
I am getting this error when I am normally running npm run dev
. also I’ve some eslintrc.json
please help me where I’m doing wrong.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Discussion #37136 · vercel/next.js - RFC: Layouts - GitHub
This RFC outlines the biggest update to Next.js since it was introduced in 2016: Nested Layouts: Build complex applications with nested routes.
Read more >Blog - Next.js 11.1
Next.js 11.1 introduces an important security patch, ES Modules support, performance improvements, Rust-based tooling, 2x faster data ...
Read more >Next JS build failing due to ''Export encountered errors on ...
I discovered that there was an object without a property that was needed to generate the page. Once I removed it, all was...
Read more >Why this nextjs code is crashing ? - YouTube
Link to my programming Video Library:https://courses.LearnCodeOnline.in/learnPick best UI color for your projects:https://UIColorPicker.
Read more >IntelliJ IDEA 2022.3 (223.7571.182 build) Release Notes
Task, IDEA-304612, Notify users when IDEA automatically enables experimental Maven import using Workspace Model API for existing projects.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Confirming that this fixes the issue on Windows build, thank you!
We just released version
7.17.4
of the SDK which should fix this issue via #6101. Feel free to ping us here if there are any more issues!