egoist/vuepack

Uncaught ReferenceError: require is not defined

nevinm opened this issue · 13 comments

How I tried to solve:

I installed requirejs 2.3.2 and later 2.2.0.

The error persists.

PS: Isn't this supposed to be present in the package.json? Or am I missing something?

steps to reproduce?

@egoist
I basically did what the README was telling me, i got stuck at this place.

$ npm install -g vue-cli
$ vue init egoist/vuepack new-project
$ cd new-project
$ npm install

# edit files and start developing
$ npm run dev

node -v
v6.7.0

npm -v
3.10.3

It works totally fine for me.

@egoist Even with the node versions that I mentioned?

I don't think the error has anything to do with the node version, but yeah, that version works too, what's detailed error message?

@egoist I will try reinstalling it again and get back here with some screenshots maybe.

I guess the require will only be undefined when you enabled electron support

@egoist Yes, disabling the electron support fixed it.
But, isn't it supposed to work even with electron enabled?

it works with electron but you should open that with npm run app instead of a browser

when elecron is enabled the require would be browserified but using node.js's native require function

@egoist Allright cool. Do update that in the README section. 👍

@egoist Ah damn I missed that 😄
Xièxiè

never mind, so I'm closing this ;)