Closed theunclehonnor closed 2 years ago
Same problem here. As this issue is 2+ months old, are there any plans to fix this?
Hey sorry about this. Both contributors here are full time programmers with families and admittedly don't have a tonne of time to spend solving every issue.
I have some time scheduled over the holidays to do some open source stuff, where I will take a look at this. Otherwise we're 100% open to PRs.
Hey sorry about this. Both contributors here are full time programmers with families and admittedly don't have a tonne of time to spend solving every issue.
I have some time scheduled over the holidays to do some open source stuff, where I will take a look at this. Otherwise we're 100% open to PRs.
Absolutely understandable :)
Hi friends if you end the file in .mjs
as opposed to .js
it will work! This has to do with node, not vue-i18n-extract. You can see an explanation of this here: https://nodejs.medium.com/announcing-a-new-experimental-modules-1be8d2d6c2ff
Hey @Spittal I'm having this same issue, I think! I recently had to change my repo package.json
to type: module
to facilitate some dependency upgrades, and this broke my i18n linting npm script due to it being in CJS.
I tried amending the file to *.cjs
, but the config cannot be found; I tried converting it to ESM and changing the file to *.mjs
but the config cannot be found, no matter what combo I do it seems like the vue-i18n-extract report
command cannot find my config file which is named as standard.
I feel like maybe this would be solved if I could explicitly specify the path to the config file? But AFAIK you can't do that on the CLI. Any suggestions...?
I found a hacky fix for this locally with using patch-package:
patch-package
docsvue-i18n-extract.config.cjs
node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js
~L57 pathToConfigFile
from .js
to .cjs
npx patch-package vue-i18n-extract
I found a hacky fix for this locally with using patch-package:
- Follow setup instructions in
patch-package
docs- Rename config file to
vue-i18n-extract.config.cjs
- Edit package file
node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js
~L57pathToConfigFile
from.js
to.cjs
- Run
npx patch-package vue-i18n-extract
FANTASTIC!!! Thank you so much for this. It would take me a few hours to find a solution like this.
Hello, i`m trying to setup vue-i18n-extract for my project. My translations are stored in js files (es6 modules) and i catch an error:
Steps to reproduce:
Are es6 modules supported?