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

Uncaught SyntaxError: Unexpected token export #40

Open
DuncanFaulkner opened this issue May 20, 2019 · 1 comment
Open

Uncaught SyntaxError: Unexpected token export #40

DuncanFaulkner opened this issue May 20, 2019 · 1 comment

Comments

@DuncanFaulkner
Copy link

Getting the following error when I build my project with this component.
we have a forked version that changes the translation to

module.exports = {
en: {
next: 'Next',
back: 'Back',
finish: 'Finish'
},
etc....
};

instead of
export default {
en: {
next: 'Next',
back: 'Back',
finish: 'Finish'
},
etc...
}

this seems to compile, just wondering if this is a known issue and whether the workaround is correct (new to vue.js).

build errors:
Hash: 5e63bb2aebd718be164c
Version: webpack 1.15.0
Time: 11909ms
Asset Size Chunks Chunk Names
static/js/manifest.bb75fd35472954a89c66.js 877 bytes 0 [emitted] manifest
static/js/vendor.380abc07fc78ef96bfef.js 2.44 MB 1, 0 [emitted] vendor
static/js/app.3620ebebb5ed57cc7c4d.js 471 kB 2, 0 [emitted] app
static/css/app.b12c05cf4044ad3d3553dc84e0a721e4.css 16.8 kB 2, 0 [emitted] app
static/js/manifest.bb75fd35472954a89c66.js.map 9.13 kB 0 [emitted] manifest
static/js/vendor.380abc07fc78ef96bfef.js.map 2.95 MB 1, 0 [emitted] vendor
static/js/app.3620ebebb5ed57cc7c4d.js.map 1.43 MB 2, 0 [emitted] app
static/css/app.b12c05cf4044ad3d3553dc84e0a721e4.css.map 27 kB 2, 0 [emitted] app
index.html 2.21 kB [emitted]

ERROR in static/js/vendor.380abc07fc78ef96bfef.js from UglifyJs
SyntaxError: Unexpected token: keyword (default) [./~/vue-stepper/src/Translations.js:1,0]

console.log errors:
VM718:1 Uncaught SyntaxError: Unexpected token export
at Object. (app.js:5910)
at webpack_require (app.js:556)
at fn (app.js:87)
at eval (eval at (app.js:3492), :7:21)
at Object. (app.js:3492)
at webpack_require (app.js:556)
at fn (app.js:87)
at eval (eval at (app.js:5658), :8:3)
at Object. (app.js:5658)
at webpack_require (app.js:556)

translation page where error is generated:
export default {
en: {
next: 'Next',
back: 'Back',
finish: 'Finish'
},
es: {
next: 'Siguiente',
back: 'Atrás',
finish: 'Finalizar'
},
pt: {
next: 'Próximo',
back: 'Voltar',
finish: 'Finalizar'
},
ja: {
next: '次へ',
back: '戻る',
finish: '完了'
},
he: {
next: 'הבא',
back: 'חזרה',
finish: 'סיום'
},
cn: {
next: '下一步',
back: '返回',
finish: '完成'
},
ru: {
next: 'Вперед',
back: 'Назад',
finish: 'Готово'
},
ar: {
next: 'التالي',
back: 'السابق',
finish: 'انهاء'
},
nl: {
next: 'Volgende',
back: 'Vorige',
finish: 'Klaar'
},
sv: {
next: 'Nästa',
back: 'Tillbaka',
finish: 'Skicka'
}
}

@vinicius91carvalho
Copy link

I have the same problem. I was using it with TypeScript and my tests with Jest and the build generated wasn't working.

My solution was rewriting the plugin with TS and include it on my project to customize it to my needs.

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