martpie / next-transpile-modules

Next.js plugin to transpile code from node_modules. Please see: https://github.com/martpie/next-transpile-modules/issues/291
MIT License
1.13k stars 85 forks source link

Next.js 12 #240

Closed martpie closed 2 years ago

martpie commented 2 years ago

Hello you there. Yes next-transpile-modules@8 works fine with Next.js 12.0.0, those below are just optimizations ;)


enkhee-Osiris commented 2 years ago

Hi @martpie, I tried next.js v12. And config.externals was returning object ({ next: 'next' }) on client build, but array ([ [Function (anonymous)] ]) on server build. So build fails on client side because of config.externals.map. BTW thank you for your awesome package.

martpie commented 2 years ago

Thanks for the report, I'll have a look asap!

mauliksoni110 commented 2 years ago

I am also receiving this error while building on local env, TypeError: config.externals.map is not a function at Object.webpack (/Users/***/node_modules/next-transpile-modules/src/next-transpile-modules.js:233:47) at Object.getBaseWebpackConfig [as default] (/Users/***/node_modules/next/dist/build/webpack-config.js:1327:32)

Is it related?

martpie commented 2 years ago

Yes it is :) apparently 12.0.1 broke for everyone using with plugin, try sticking with 12.0

enkhee-Osiris commented 2 years ago

Turns out they fixed it https://github.com/vercel/next.js/pull/30466/files

ZionSimilarWeb commented 2 years ago

just checked it with nextjs 12 and it works. Thank you very much man, I couldn't activate the react firebase ui component as it import a css from the node_modules