runtime-only build from CDN contain references to process.env.NODE_ENV - offer alternative build?
See original GitHub issueI’m bundling my code only and using Vue from unpkg.
But even if I’m not using the template
option, I’m forced to use the standalone build because the runtime-only one has some node variables, like process
or module
.
Uncaught ReferenceError: process is not defined
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Why is process.env.NODE_ENV undefined? - Stack Overflow
process.env is a reference to your environment, so you have to set the variable there. To set an environment variable in Windows: SET...
Read more >Working with Environment Variables in Node.js - Twilio
When your Node.js process boots up, it'll automatically provide access to all existing environment variables by creating an env object ...
Read more >Handling runtime environment variables in create-react-apps
A new package called runtime-env-cra allows you to handle environment variables in quick and easy way with create-react-apps.
Read more >Node Environment Variables: Process env Node
Node environment variables are strategies to define and consume environment-specific configurations and process env node. Learn how.
Read more >Basic Features: Environment Variables - Next.js
Next.js has built-in support for loading environment variables from .env.local into ... This means that process.env is not a standard JavaScript object, ...
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 FreeTop 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
Top GitHub Comments
@LinusBorg
module.exports
gave problems too… @posva Yeah, there is a couple of solutions, but… since they are on a CDN, they should be browser ready; with a minified version too.@NicolasParada As a fix, add a script tag that adds
process.env.NODE_ENV
to the global namespace:@fnlctrl I’m not sure weither these variables are supposed to be present in a build on a CDN. At least it’s inconvenient to offer CDN access to these files and then require a workaround like above to use them.
Think we should discuss internally how to deal with this.