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 < #4

Open
rafaberaldo opened this issue Mar 6, 2017 · 14 comments
Open

Uncaught SyntaxError: Unexpected token < #4

rafaberaldo opened this issue Mar 6, 2017 · 14 comments
Assignees

Comments

@rafaberaldo
Copy link

rafaberaldo commented Mar 6, 2017

I'm getting this error after just installing on my project

Edit: as standalone component.

I did the npm install vue-bulma-notification --save and when I try to import Notification from 'vue-bulma-notification' I get this error:

Uncaught SyntaxError: Unexpected token <

@luventa
Copy link
Member

luventa commented Mar 6, 2017

did you use webpack and vue-loader?

@rafaberaldo
Copy link
Author

rafaberaldo commented Mar 6, 2017

Yep, both. I'm using the CLI from electron-vue

@luventa
Copy link
Member

luventa commented Mar 6, 2017

let me try with this template. will get back to you soon.

@rafaberaldo
Copy link
Author

rafaberaldo commented Mar 6, 2017

Just tested installing the components on my own components folder and it worked. Is there any way to use it as standalone to just import from node_modules?

Edit: It's also missing the bounce-*'s css classes for the transition.

Maybe I didn't get it and these components are only to be usable on vue-admin?

@luventa
Copy link
Member

luventa commented Mar 6, 2017

I tested with electron-vue but your issue didn't occur.
Do you need my sample code? I can create a repo

I installed these dependencies:
devDependencies

"node-sass": "^4.5.0",
"sass-loader": "^6.0.2",

dependencies

"bulma": "^0.3.2",
"vue": "^2.2.1",
"vue-bulma-notification": "^1.1.1"

@luventa
Copy link
Member

luventa commented Mar 6, 2017

standalone component will be the next step for vue bulma.

@rafaberaldo
Copy link
Author

Ah, so we need to add vue-admin either way?

@luventa
Copy link
Member

luventa commented Mar 6, 2017

no, need bulma and related loaders. Vue admin is just an united demo for all vue-bulma components.

repo https://github.com/luventa/electron-vue-test

@rafaberaldo
Copy link
Author

rafaberaldo commented Mar 6, 2017

Could you please show me the code on that repo you said?

@luventa
Copy link
Member

luventa commented Mar 6, 2017

@rafaberaldo
Copy link
Author

Got it to work, I updated all my packages and added the bulma alias on webpack.

Thanks a lot @luventa !

@luventa
Copy link
Member

luventa commented Mar 6, 2017

np

@luventa luventa closed this as completed Mar 6, 2017
@rafaberaldo
Copy link
Author

rafaberaldo commented Mar 6, 2017

So I was getting everything in order and the error occurried again, I noticed that when I have

"vue-bulma-notification": "^1.1.1",

on my dependencies, I get that error again, and when I delete that line it works great.

Do you have any idea what could be?

Edit: I Also noticed you don't have the dependency on your repo (app/package.json).

Edit 2: Looks like it have to stay on devDependencies.

@luventa
Copy link
Member

luventa commented Mar 6, 2017

I guess this situation is cased by webpack config of electron-vue. And I'm trying to figure out why.
I test with devDependencies and it works fine with both dev and build.
Thanks for your Edit 2.

it doesn't make sense. I need to raise an issue to electron-vue...

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