Closed AbdUlHamedMaree closed 3 years ago
my next.config.js
// // @ts-check
// /**
// * @type {import('next').NextConfig}
// **/
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
const { withSentryConfig } = require('@sentry/nextjs');
const nextTranslate = require('next-translate');
const moduleExports = nextTranslate({
images: {
domains: [
// our domains
'lamar-clinic.com',
'www.lamar-clinic.com',
'api.lamar-clinic.com',
// mock domains
'i.pravatar.cc',
'picsum.photos',
],
},
reactStrictMode: true,
distDir: 'build',
webpack5: true,
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
});
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(moduleExports, SentryWebpackPluginOptions);
Hi, it looks like this might be being added by one of your plugins in your next.config.js
as next-translate
attempts to detect if it should leverage getInitialProps
or not, can you try removing your custom configuration and seeing if the problem persists?
This seems unlikely to be caused by Next.js itself, if you are able to still be able to reproduce this after removing the custom plugins in your next.config.js
please provide a link to a repo to allow further investigation!
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
What version of Next.js are you using?
11.0.1
What version of Node.js are you using?
14.16.1
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
my project is so simple, but I face this problem where a wrong warning about using
getInitialProps
inpages/_app
, I didn't usegetInitialProps
in_app
and the_app
exported with no HOC, this warning followed by all pages being SSR, so no SEO and to static optimization features, my _app is so large 😊but you can clearly see that I'm not usinggetInitialProps
or a HOC._app.tsx
Expected Behavior
this warning to not appears in the console and all pages being SSG.
To Reproduce
create
pages/_app
with the same configuration and it will produce the problem