Change the way detect nodejs environment
See original GitHub issueCan we use
var isNodeEnv = function isNodeEnv() {
return typeof global != 'undefined';
};
instead of
var isNodeEnv = function isNodeEnv() {
return typeof window === 'undefined' || typeof document === 'undefined';
};
To make angular universal works with some libraries, I’ve to provide a shim for window and document objects. If we use global object which is node-specific, we can address the issues better.
Thanks for the fantastic library.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Node JS, detect production environment - Stack Overflow
Node JS, detect production environment · I use local config file, that not under git and extends main config. So any local key...
Read more >Working with Environment Variables in Node.js - Twilio
Environment variables are a great way to configure parts of your Node.js application. Learn how to work with them using helpful tools such ......
Read more >Using Environment Variables in Node.js for App Configuration ...
Environment variables are considered the best way to configure applications, with the main benefits being: Secrets such as database credentials ...
Read more >NVM, the Easiest Way to Switch Node.js Environments on ...
Then type CTRL + X from a Mac, Y to save the changes, and Enter and you should be back where you started...
Read more >Debug Node.js Apps using Visual Studio Code
js debugger automatically restarts after the debug session has ended. This feature is useful if you use nodemon to restart Node.js on file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Reopening the issue because unfortunately, I had to undo this change, see details in #1927
Basically, I think the error “SweetAlert2 requires document to initialize” was correct in the first place. Just preventing that error from happening will not change the fact that “SweetAlert2 requires document to initialize”.