-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Webpack 5 still shows deprecation warnings with Next 10 #18758
Comments
Maybe it is related to #18753. For validation please ensure that you lock files don`t reference older webpack or nextjs versions. My setup is identical, due to the issue mentioned I had to remove the webpack folder distributed with the NextJs dependency. Execute the build again and see if you still get those warnings. |
@gurkerl83 I don't think these are the same issues. I'm using Yarn Berry and the |
@nicholaschiang Did you try it? Is there a webpack folder within the nextjs node-modules folder. This is from my package.lock json, I still use npm instead of yarn, but the bundles content should be the same, no matter what tool you are using.
|
Can you post your next.config.js, most likely you have custom webpack configuration. |
Yeah, sure @timneutkens here it is: const path = require('path');
const withImages = require('next-images');
const { locales } = require('./lib/intl/config.json');
module.exports = withImages({
reactStrictMode: true,
sassOptions: {
includePaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'src/*/node_modules'),
],
},
images: {
domains: [
'assets.tutorbook.app',
'firebasestorage.googleapis.com',
'lh3.googleusercontent.com',
],
imageSizes: [260, 160, 120, 85, 40, 24],
},
async redirects() {
return [
{
source: '/signup',
destination: '/default/signup',
permanent: true,
},
{
source: '/search/:slug*',
destination: '/default/search/:slug*',
permanent: true,
},
];
},
webpack(config, { isServer }) {
if (!isServer && process.env.ANALYZE === 'true') {
// Only run the bundle analyzer for the client-side chunks.
// @see {@link https://github.com/vercel/next.js/issues/15481}
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: './analyze/client.html',
generateStatsFile: true,
})
);
}
config.module.rules.push({
test: /\.hbs$/,
use: 'raw-loader',
});
return config;
},
}); The only thing that I could think of here would be that |
Potentially, or the |
Going to close this as Next.js currently does not have deprecation warnings so it's something in your app. |
I have the same issue with this config and
|
Seeing similar warnings when using
|
Also seeing this on local and vercel build logs Next.js version: 11.1.2
|
I have the same message with nextjs 12.0.2, both locally and in vercel logs
|
I also saw the same deprecation warning message when building nextjs 11. As a result of checking the webpack bundle5.js file, it was commented out that it will be deleted from webpack6 as shown in the screenshot below. |
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. |
Bug report
Describe the bug
Just installed Next 10 and upgraded to Webpack 5 (added a Yarn resolution to
package.json
) and I'm still getting deprecation warnings when building:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
yarn build:analyze
from the repository root.Expected behavior
There should be no deprecation warnings when using Next 10 with Webpack 5.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
The text was updated successfully, but these errors were encountered: