notification icon indicating copy to clipboard operation
notification copied to clipboard

Uncaught SyntaxError: Unexpected token <

Open rafaberaldo opened this issue 7 years ago • 14 comments

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 <

rafaberaldo avatar Mar 06 '17 01:03 rafaberaldo

did you use webpack and vue-loader?

luventa avatar Mar 06 '17 01:03 luventa

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

rafaberaldo avatar Mar 06 '17 01:03 rafaberaldo

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

luventa avatar Mar 06 '17 01:03 luventa

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?

rafaberaldo avatar Mar 06 '17 01:03 rafaberaldo

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 avatar Mar 06 '17 02:03 luventa

standalone component will be the next step for vue bulma.

luventa avatar Mar 06 '17 02:03 luventa

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

rafaberaldo avatar Mar 06 '17 02:03 rafaberaldo

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

luventa avatar Mar 06 '17 03:03 luventa

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

rafaberaldo avatar Mar 06 '17 03:03 rafaberaldo

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

That click me button.

luventa avatar Mar 06 '17 03:03 luventa

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

Thanks a lot @luventa !

rafaberaldo avatar Mar 06 '17 03:03 rafaberaldo

np

luventa avatar Mar 06 '17 03:03 luventa

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.

rafaberaldo avatar Mar 06 '17 03:03 rafaberaldo

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

luventa avatar Mar 06 '17 07:03 luventa