vue-bulma / notification

Notification component for Vue Bulma
MIT License
32 stars 19 forks source link

Uncaught SyntaxError: Unexpected token < #4

Open rafaberaldo opened 7 years ago

rafaberaldo commented 7 years ago

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 commented 7 years ago

did you use webpack and vue-loader?

rafaberaldo commented 7 years ago

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

luventa commented 7 years ago

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

rafaberaldo commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

standalone component will be the next step for vue bulma.

rafaberaldo commented 7 years ago

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

luventa commented 7 years ago

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 commented 7 years ago

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

luventa commented 7 years ago

https://github.com/luventa/electron-vue-test/blob/master/app/src/renderer/components/LandingPageView.vue

That click me button.

rafaberaldo commented 7 years ago

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

Thanks a lot @luventa !

luventa commented 7 years ago

np

rafaberaldo commented 7 years ago

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 commented 7 years ago

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...