You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> vue-gettext-compile
/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/loaders.js:32
throw error;
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/wilhemarnoldy/Developpements/Berlioz/gettext.config.js from /Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/loaders.js not supported.
gettext.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename gettext.config.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/wilhemarnoldy/Developpements/Berlioz/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at module.exports (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/import-fresh/index.js:32:59)
at loadJs (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/loaders.js:16:18)
at ExplorerSync.loadFileContentSync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:84:26)
at ExplorerSync.createCosmiconfigResultSync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:89:30)
at ExplorerSync.loadSearchPlaceSync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:70:25)
at ExplorerSync.searchDirectorySync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:55:32)
at run (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:35:27)
at cacheWrapperSync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/cacheWrapper.js:28:18)
at ExplorerSync.searchFromDirectorySync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:47:49)
at ExplorerSync.searchSync (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/cosmiconfig/dist/ExplorerSync.js:27:25)
at loadConfig (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/vue3-gettext/dist/bin/gettext_compile.js:105:30)
at Object.<anonymous> (/Users/wilhemarnoldy/Developpements/Berlioz/node_modules/vue3-gettext/dist/bin/gettext_compile.js:144:14) {
code: 'ERR_REQUIRE_ESM'
}
Package version is : 2.4.0
Thanks a lot
The text was updated successfully, but these errors were encountered:
@Wewill thanks for reporting this. i was no aware that this was an issue, but I'm working on esm-related stuff in #41 that should fix this aswell.
i don't quite remember how I set up cosmiconfig (and i'll replace it soon), but here are 2 ideas you could try in the meantime (I have no idea if any of this will work):
rename the file to gettext.config.cjs
rename the file to gettext.config.json and write the config as json instead of js
@youthlin i will try to implement a ts-node based loader to enable this. i don't have a lot of time at the moment, so all of that will probably take a while.
Package version is : 2.4.0
Thanks a lot
The text was updated successfully, but these errors were encountered: