Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide documentation on how to use as ES6 module #217

Open
jplaverdure opened this issue Mar 26, 2024 · 4 comments
Open

Provide documentation on how to use as ES6 module #217

jplaverdure opened this issue Mar 26, 2024 · 4 comments

Comments

@jplaverdure
Copy link

jplaverdure commented Mar 26, 2024

Hello,

I'm a bit of a newbie to the JS ecosystem and understand there are 2 module loading schemes (commonJS and ES6)
It would be nice to have a bit more documentation on how to use this tool in the context of an ES6 project.

It seems everything I attempt results in:

[vue-i18n-extract] SyntaxError: Cannot use import statement outside a module
    at /u/jpl/Documents/binfo/qarome/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:166:53
    at Array.map (<anonymous>)
    at readLanguageFiles (/u/jpl/Documents/binfo/qarome/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:153:26)
    at Object.createI18NReport (/u/jpl/Documents/binfo/qarome/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:291:29)
    at Object.<anonymous> (/u/jpl/Documents/binfo/qarome/test_extract.js:3:31)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

I see the presence of a vue-i18n-extract.modern.mjs file in the dist folder but how do I make use of it ?
Surely I'm not the only one trying to figure out how to make this work..

All help is welcome !

@jplaverdure
Copy link
Author

Forgot to mention, but I'm trying to use this on a Quasar project.. Maybe that explains the issues I'm running into ?

@mreduar
Copy link

mreduar commented May 14, 2024

@jplaverdure do you resolve this issue?

@jplaverdure
Copy link
Author

I unfortunately resolved it by using the vue-gettext plugin which worked perfectly in my case.

@mreduar
Copy link

mreduar commented May 15, 2024

I solved it with this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants