-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Node-Webkit not working with moment.js #2075
Comments
Because it detects that Node.js engine is present and thus it decides not to create a global. To work around this decision, install Moment.js as an npm module ( An added bonus is that a local file works faster than a remote server ( |
Crystal clear. Thanks! |
Thanks for this! |
Ohh, i faced this issue by myself, and i lost a day to sort it out by myself :) Anyway as was mentioned it works pefectly well as in node context. cheers. |
moment = global.moment |
I'm using electron to create a desktop app with angular, There's no problem when i use gulp-webserver in develop time, but when i need to test in electron prebuilt environment then i see this error. I can fix in electron env with using require npm package but how can fix in both? |
@cybercoder You should ask that question in an Electron-related issue (this one is not: this one is NW.js-related) because there you'll have more developers with Electron-related experience listening. |
This bug is super easy to reproduce:
package.json
index.html
Launch nw (tested with 0.9.2 an 0.10.0). Open console.
Launch browser, open index.html
No idea why
moment
is not defined in node-webkit since it is in other browsers.Cheers
The text was updated successfully, but these errors were encountered: