3 ms·
I'm building a custom server (which hopefully now can be replaced with middleware?) which I build with tsc: $ tsc --strict --esModuleInterop --moduleResolution
by svachalek 5y ago
I'm building a custom server (which hopefully now can be replaced with middleware?) which I build with tsc:
$ tsc --strict --esModuleInterop --moduleResolution node --jsx react --outdir build server.ts
node_modules/next/dist/server/config-shared.d.ts:1:15 - error TS2724: '"next/dist/compiled/webpack/webpack"' has no exported member named 'webpack5'. Did you mean 'webpack'?
1 import type { webpack5 } from 'next/dist/compiled/webpack/webpack';
~~~~~~~~
Probably there's some workaround but the compile error seems legit. Is there something I can do about it until I figure out middleware?
- theobr 5y agoWebpack is no longer a dependency of Next.js - this was the big announcement about the compiler. You will have to opt out of the new SWC compiler (if this is an option atm)
- acemarke 5y agoThat doesn't seem correct. Next _does_ still use Webpack - it's what does the actual bundling: > Underlying webpack improvements: We've made numerous improvements to webpack, including optimizing Fast Refresh and making on-demand entries more reliable. > After making webpack 5 the default in Next.js 11, we've now officially removed webpack 4. We've worked closely with the community to ensure a smooth transition to webpack 5. SWC is the equivalent of Babel for transpiling JS, not Webpack for bundling.