Skip to content

Opaque error for invalid CSS after upgrade: TypeError: Cannot read property '0' of undefined #6282

Closed
@buildbreakdo

Description

@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 (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):

  1. Add invalid CSS to any .css file, like:
label[for=*] {
  margin-right: 12px;
}
  1. 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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions