Closed slavb18 closed 1 year ago
Hi! 👋
.mjs
is now supported for Next.js configs? Did you try with a classic next.config.js
just to see if it'd work?
Hi! wave
.mjs
is now supported for Next.js configs? Did you try with a classicnext.config.js
just to see if it'd work?
classic next.config.js working:
const withTM = require('next-transpile-modules')([
'next-auth',
]);
const fs=require('fs');
const nextConfig = {
trailingSlash: false,
};
module.exports=withTM(nextConfig);
but in my case mjs is required to import es6 module
this issue can be fixed? or should I supply additional info ?
Sorry for the silence, I haven't had a look at it yet, but it definitely should be supported!
Are you trying to transpile a local package or an npm package? If an npm package, which one? next-auth (actual package does not matters)
Describe the bug A clear and concise description of what the bug is (please include logs from your terminal with debug enabled).
Error in console:
To Reproduce Steps to reproduce the behavior (a reproduction is even better):
Create next.config.mjs
then start app
npm run dev
Example project https://github.com/slavb18/hello-world-app
Expected behavior A clear and concise description of what you expected to happen. There should be no error Caching failed for pack: Error: Can't resolve 'fs'
Setup
next-transpile-modules
version: 9.0.0npm
/yarn
version:8.1.1