Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
whydea opened this issue Oct 31, 2022 · 7 comments
Closed

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

whydea opened this issue Oct 31, 2022 · 7 comments

Comments

@whydea
Copy link

whydea commented Oct 31, 2022

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

@getsentry-release
Copy link

Routing to @getsentry/ops for triage. ⏲️

@getsentry-release
Copy link

Routing to @getsentry/team-web-sdk-frontend for triage. ⏲️

1 similar comment
@getsentry-release
Copy link

Routing to @getsentry/team-web-sdk-frontend for triage. ⏲️

@lforst lforst transferred this issue from getsentry/sentry Nov 2, 2022
@lforst lforst changed the title sentry problem with nextjs Next.js build Error "export * from '...' in a page is disallowed" Nov 2, 2022
@lforst
Copy link
Member

lforst commented Nov 2, 2022

I have a feeling that this is a duplicate of #6085 which we just fixed.

Just to confirm: Are you running next build on Windows?

@casperiv0
Copy link

Just to confirm: Are you running next build on Windows?

Yes, I'm able to reproduce this on Windows, but not WSL2/Linux

@lforst
Copy link
Member

lforst commented Nov 3, 2022

Just to confirm: Are you running next build on Windows?

Yes, I'm able to reproduce this on Windows, but not WSL2/Linux

Cool, we just released in version 7.17.4 (including #6101) which should fix this. Let us know if the new version works for you.

For now, I will close this issue as it is a duplicate of #6085

@lforst lforst closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2022
@casperiv0
Copy link

Thanks! I will try update tonight, will keep you posted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants