Skip to content

Bug: styled-components v6で動かない #369

@mimokmt

Description

@mimokmt

できる限り詳細に、不具合の内容と再現方法を報告してください

このようなエラーが出る

$ yarn build
yarn run v1.22.19
$ next build
./src/components/Modal.tsx
12:6  Warning: React Hook useEffect has a missing dependency: 'state'. Either include it or remove the dependency array.  react-hooks/exhaustive-deps
info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
- info Linting and checking validity of types ..Failed to compile.
./node_modules/@charcoal-ui/styled/src/util.ts:10:10
Type error: Module '"styled-components"' has no exported member 'CSSObject'. Did you mean to use 'import CSSObject from "styled-components"' instead?
   8 | } from '@charcoal-ui/utils'
   9 | import { CharcoalAbstractTheme, EffectType, Key } from '@charcoal-ui/theme'
> 10 | import { CSSObject } from 'styled-components'
     |          ^
  11 | 
  12 | /**
  13 |  * Function used to assert a given code path is unreachable
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

v5 -> v6でいくつかの破壊的変更や、 @types/styled-components を使わなくなったりしているのでそのあたりが影響していそう

使用している charcoal および周辺環境

  • @charcoal-ui/styled
  • @charcoal-ui/react
  • @charcoal-ui/react-sandboxあたり?

コード例へのリンク

No response

現在の挙動

No response

期待される挙動

styled-components@^6.0.0で動く、理想としてはstyled-components@^5.0.0でも動く

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions