Cannot read property 'env' of undefined
See original GitHub issueI am unable to start my app unless I failed to follow instructions. The error is:
context.env === "production" ? sassRule.loader : sassRule.use;
package.json:
"dependencies": {
"@craco/craco": "^2.4.0",
"antd": "^3.11.0",
"craco-antd": "^1.5.0",
"react": "^16.6.3",
"react-dom": "^16.6.3",
"react-scripts": "^2.1.1"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test"
},
craco.config.js
const CracoAntDesignPlugin = require("craco-antd");
module.exports = {
plugins: [{ plugin: CracoAntDesignPlugin }]
};
Any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'env' of undefined - JavaScript
This is my app.js page code its working fine but when i click test completed button its not completed var express = require("express");...
Read more >Vue cli - TypeError: Cannot read property 'env' of undefined
Try to define it as a computed property using require function : computed:{ background(){ return require("`${process.env.
Read more >Cannot read property 'env' of undefined · Issue #1277 - GitHub
this a bug report Parcel produced an error but builds the packages just fine. Configuration (.babelrc, package.json, cli command) ...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Uncaught TypeError: Cannot read property 'env' of undefined
HTML : Uncaught TypeError: Cannot read property ' env' of undefined [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
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
When running running
craco start
with NODE_ENV set to production, the process prints out this exception. The problem was actually me trying to run craco in production mode. You should not run craco in production, you should run craco build. My suggestion is that craco exits with a polite error message telling you not to run craco in production mode.Awesome, and thanks for the tip! I didn’t realize Travis CI supported Windows now, so that’s awesome! I’ll try to get the tests running on Windows as well.