question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent extraction to js

See original GitHub issue

When this plugin reads content from js, it uses eval(fs.readFileSync(langPath, 'utf8'));

But when writing, it uses

        const jsFile = `export default ${stringifiedContent}; \n`;

So, it can not read it’s own files.

export default {
^^^^^^

SyntaxError: Unexpected token 'export'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
theunclehonnorcommented, Sep 21, 2021

Most likely, there is no support for es6 modules, read more here https://github.com/pixari/vue-i18n-extract/issues/142

1reaction
theunclehonnorcommented, Sep 15, 2021

The problem still remains relevant. Version 2.0.4. Command: yarn run vue-i18n-extract use-config vue-i18n-extract.config.js:

module.exports = {
    vueFiles: '*.vue',
    languageFiles: '*.js',
    output: false,
    add: false,
    remove: false,
    ci: false,
    separator: '.'
}

Error message:

user@user-computer:~/path/to/my/project$ yarn run vue-i18n-extract use-config
yarn run v1.22.11
$ path/to/my/project/node_modules/.bin/vue-i18n-extract use-config

Using config file found at path/to/my/project/vue-i18n-extract.config.js
[vue-i18n-extract] SyntaxError: Unexpected token 'export'
    at path/to/my/project/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:184:47
    at Array.map (<anonymous>)
    at readLanguageFiles (path/to/my/project/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:172:24)
    at createI18NReport (path/to/my/project/node_modules/vue-i18n-extract/dist/vue-i18n-extract.umd.js:322:27)
    at CAC.<anonymous> (path/to/my/project/node_modules/vue-i18n-extract/bin/vue-i18n-extract.js:39:5)
    at CAC.runMatchedCommand (path/to/my/project/node_modules/cac/dist/index.js:611:34)
    at CAC.parse (path/to/my/project/node_modules/cac/dist/index.js:538:12)
    at Object.<anonymous> (path/to/my/project/vue-i18n-extract/bin/vue-i18n-extract.js:48:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Inconsistent extraction to js · Issue #103 · Spittal/vue-i18n-extract
When this plugin reads content from js, it uses eval(fs.readFileSync(langPath, 'utf8')); But when writing, it uses const jsFile = `export ...
Read more >
3 Ways to Avoid Inconsistent Extractions - Clive Coffee
Here are 3 areas of improvement to reduce these espresso shot inconsistencies. Coffee freshness; Grind retention; Volume of beans in the hopper. All...
Read more >
Help me troubleshoot consistently uneven extraction
Below are a serious of videos which will hopefully help troubleshoot what I consistently get a very uneven extraction.
Read more >
Strange inconsistent extraction times with constant settings
Inexplicably, my extractions have gone hugely inconsistent and I can't work out why. Same grind setting, same dose, same final output, ...
Read more >
EK Inconsistent grind - Q&A - Barista Hustle Community Forum
We use our EK43 for filter grinding only - batch, V60 and aeropress. Recently it had it's burrs replaced and now we notice...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found