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 ReferenceError: require is not defined #83

Closed
nevinm opened this issue Dec 27, 2016 · 13 comments
Closed

Uncaught ReferenceError: require is not defined #83

nevinm opened this issue Dec 27, 2016 · 13 comments

Comments

@nevinm
Copy link

nevinm commented Dec 27, 2016

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?

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

steps to reproduce?

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

@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

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

It works totally fine for me.

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

@egoist Even with the node versions that I mentioned?

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

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?

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

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

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

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

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

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

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

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

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

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

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

It's already here https://github.com/egoist/vuepack/blob/master/docs/electron.md 😉

@nevinm
Copy link
Author

nevinm commented Dec 27, 2016

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

@egoist
Copy link
Owner

egoist commented Dec 27, 2016

never mind, so I'm closing this ;)

@egoist egoist closed this as completed Dec 27, 2016
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