preact-cli: TypeError: Cannot read property 'flags' of undefined
Do you want to request a feature or report a bug? A Bug
What is the current behaviour?
Running yarn run build
when installing @types
modules breaks the build.
After installing the Typescript template, I’m trying to install styled-components, all goes fine until I install @types/styled-components
.
If the current behaviour is a bug, please provide the steps to reproduce.
preact create typescript my-project
yarn add styled-components
yarn add -D @types/styled-components
yarn run build
INTERNAL ERROR: Cannot read property 'flags' of undefined
What is the expected behaviour?
Being able to install @types
packages.
OS: macOS 10.15.3 Terminal: Hyper 3.1.0 Shell: zsh Node: v13.8.0 npm: 6.13.7 preact-cli: 2.2.1
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 16 (10 by maintainers)
Commits related to this issue
- unbreak build see https://github.com/preactjs/preact-cli/issues/1030 — committed to kylemcdonald/facework by outofambit 4 years ago
- Squashed commit of the following: commit 7965ae9d6b4344e80dbc3329e52954bdc83e84da Author: evelyn masso <coding@outofambit.com> Date: Sun Oct 11 16:31:01 2020 -0700 add todo commit a1ff377fe98... — committed to kylemcdonald/facework by outofambit 4 years ago
@RyanChristian4427 wrote:
My PR does not remove Jest, but it replaces outdated render spy with Enzyme integration. Just wanted to clarify that to prevent any false assumptions.
I added that, and it was just to allow the test lib to run. Nothing more. Definitely get rid of it. It was a temporary hack so all parts of the template “worked”.
Commenting out the lines in
src/declaration.d.ts
made the error go away. But removing the lines might break something else.It seems to be an issue with typescript itself. There is an open issue in typescript for the same.
Reference link: https://github.com/microsoft/TypeScript/issues/37165