victorsferreira / vue-session

A simplistic session plugin for VueJS backed by SessionStorage and LocalStorage
203 stars 42 forks source link

Unexpected token export #1

Closed arthurvasconcelos closed 7 years ago

arthurvasconcelos commented 7 years ago

Hi. I'm using electron-vue and have webpack all configured to handle ES6/7, but despite this I am facing a bug with export default. So I tried change to exports.default but $session doesn't appear in this.

screenshot from 2017-03-11 20-48-49

victorsferreira commented 7 years ago

Hello, @arthurvasconcelos

I confess I have no experience with electron, so I can't point right now what could be the problem with the webpack configuration, but since export is not yet supported by browsers, the word export shouldn't be in your javascript file like that.

Open the console (press F12 or right-click > inspect) and type:

export default const foo = 'something'

Yet a valid es6/es7 javascript code, it will throw an error just like the one in your picture.

I released a major update in Vue-Session that may help you, or perhaps depending on your configuration you can try to load it with unpkg. I'm still working on other solutions that could fix problems like yours.

Try the latest (0.9.4) version and let me know if it works for you

arthurvasconcelos commented 7 years ago

@victorsferreira just to inform that the latest version fixed the bug. I will continue using =D great lib! Thanks!