Hello, our team is migratiing from sapper to sveltekit and I'm struggling a bit with a script with postcss-cli which we use to generate a json file with custom variables to be used in js.
I'm getting the folowing error: require() of ES modules is not supported. require() of /Xxxx/xxxxxxxxx/xxxxxx/kit/src/assets/styles/postcss.config.js from /Xxxx/xxxxxxxxx/xxxxxx/kit/node_modules/lilconfig/dist/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename postcss.config.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/mantismamita/radiofrancewww/kit/package.json.
The problem is that we don't want to use cjs in the project. Is there a possiblity of using a package that uses ES modules thus avoiding the need to use cjs in our postcss.config?
The text was updated successfully, but these errors were encountered:
Through a chain of dependencies, we are blocked on davidtheclark/cosmiconfig#224; contributing there would be the first step to offering ESM support. Otherwise, you'll be forced to use the .cjs extension.
We're now dependent on https://github.com/antonk52/lilconfig; which is better maintained and should be better able to support this; just need someone to open an issue/PR there.
Hello, our team is migratiing from sapper to sveltekit and I'm struggling a bit with a script with postcss-cli which we use to generate a json file with custom variables to be used in js.
I'm getting the folowing error:
require() of ES modules is not supported. require() of /Xxxx/xxxxxxxxx/xxxxxx/kit/src/assets/styles/postcss.config.js from /Xxxx/xxxxxxxxx/xxxxxx/kit/node_modules/lilconfig/dist/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename postcss.config.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/mantismamita/radiofrancewww/kit/package.json.The problem is that we don't want to use cjs in the project. Is there a possiblity of using a package that uses ES modules thus avoiding the need to use cjs in our postcss.config?
The text was updated successfully, but these errors were encountered: