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

'require is not defined' #3359

Closed
xzh-loop opened this issue Apr 11, 2015 · 3 comments
Closed

'require is not defined' #3359

xzh-loop opened this issue Apr 11, 2015 · 3 comments

Comments

@xzh-loop
Copy link

package.json: "main": "htttp://localhost"

The html file is loaded from the server. require('nw.gui') cause an error 'require is not defined'.

However, this error would not appear when this html file is loaded from local directory.

@makerimages
Copy link

Sounds like a case of #199 ?

@rdtsc
Copy link

rdtsc commented Apr 11, 2015

I think it's just a case of not having specified a node-remote key in your manifest. For example:

package.json

{
  "name": "your-nwjs-app",
  "main": "http://localhost/",
  "node-remote": "localhost"
}

⚠️ DANGER: This grants sources matching the specified node-remote pattern node-level execution privileges. You should be as specific as possible when constructing such patterns.

@xzh-loop
Copy link
Author

@rdtsc , many thanks for your help! I just try and succeed.

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

3 participants