Opaque error for invalid CSS after upgrade: TypeError: Cannot read property '0' of undefined
Created by: buildbreakdo
After upgrading from react-scripts 1.1.4 to 2.1.3 see an opaque error message when trying to build:
Error in TypeError: Cannot read property '0' of undefined
Thought this might be related to #2069 (closed) (determined to be bug of package managers?), but after trial and error determined it was related to invalid CSS.
Reproduce (react-scripts 2.1.3):
- Add invalid CSS to any .css file, like:
label[for=*] {
margin-right: 12px;
}
yarn build
Output:
Error in TypeError: Cannot read property '0' of undefined
This invalid CSS does not produce a build error in react-scripts 1.1.4, so this is something people will bump into when they upgrade and not really know what to do (e.g., claim the upgraded version is broken).