Skip to content

Next.js build Error "export * from '...' in a page is disallowed" #6111

@whydea

Description

@whydea

Environment

SaaS (https://sentry.io/)

Version

7.17.3

Steps to Reproduce

step 1: yarn add @sentry/nextjs
step 2: npx @sentry/wizard -i nextjs
step 3: migrated file next.config.wizardcopy.js

/** @type {import('next').NextConfig} */
const { withSentryConfig } = require('@sentry/nextjs');

const nextConfig = {
reactStrictMode: true,
swcMinify: true,

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: false,
},
};

const sentryWebpackPluginOptions = {
// 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

silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};

// 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, sentryWebpackPluginOptions);

Expected Result

It would be expected that everything would work out fine

Actual Result

error - ./src/pages/_app.tsx
Error:
x Using export * from '...' in a page is disallowed. Please use export { default } from '...' instead.
| Read more: https://nextjs.org/docs/messages/export-all-in-page
,----
2 | export * from './_app.tsx?sentry_wrapped';
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`----

I don't know if this error already occurred as it's the first time I'm testing sentry for nextjs.
I tested it on nextjs 12 and the error is also happening.

I would like help to know if I'm doing something wrong or if it's a possible bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions