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

Module parse failed: Unexpected token (200:6) You may need an appropriate loader to handle this file type. #2

Closed
4dcode opened this issue Oct 19, 2019 · 4 comments

Comments

@4dcode
Copy link

4dcode commented Oct 19, 2019

I'm trying to use your code in a vue app using NodeJS

ERROR Failed to compile with 1 errors 6:35:08 PM

error in ./node_modules/ovoid/src/index.js

Module parse failed: Unexpected token (200:6)
You may need an appropriate loader to handle this file type.
| return {
| 'Authorization': this.authToken,
| ...this.headers
| }
| }

@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/MyAccount.vue 436:12-28
@ ./src/views/MyAccount.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js

@apriady
Copy link
Owner

apriady commented Oct 19, 2019

Hi,
Can i look at the code that you use when calling this plugin?

@4dcode
Copy link
Author

4dcode commented Oct 20, 2019

Hi,

Thank you for your response.
Attached the file.

npm install is done.
On line 433 " const OVOID = require('ovoid') " I include the ovoid.
On line 585 (linkOvoWallet) I try to do the ovoid.login2FA.

Kind Regards,
Martin

MyAccount.vue.zip

@alimuddinhasan
Copy link

Hi,

Thank you for your response.
Attached the file.

npm install is done.
On line 433 " const OVOID = require('ovoid') " I include the ovoid.
On line 585 (linkOvoWallet) I try to do the ovoid.login2FA.

Kind Regards,
Martin

MyAccount.vue.zip

Hi,
Do your javascript version support spread operator like ...this.headers?
If not please try to update to ES6 and try again

@4dcode
Copy link
Author

4dcode commented Oct 23, 2019

Hi,
My system says I'm on ES6 but but still did not work in the first place.

I changed the code on line 197 in index.js to the code below and after that it's working without errors.
See this link: http://es6-features.org/#SpreadOperator

Thanks for your support.
Martin

_aditionalHeader() {
return {
'Authorization': this.authToken.concat(this.headers)
// ...this.headers
}
}

@4dcode 4dcode closed this as completed Oct 31, 2019
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

3 participants