我的项目的设置是tsdx(基于Rollup和Typescript)。
在我的 IDE (vscode) 中工作一切看起来都很好,甚至运行也yarn tsc没有错误。
当我运行时yarn build(即tsdx build),我收到以下错误:
(typescript) Error: /home/me/dev/app/src/components/alert/Alert.tsx(36,7): semantic error TS2742: The inferred type of 'AlertContainer' cannot be named without a reference to '@emotion/serialize/node_modules/csstype'. This is likely not portable. A type annotation is necessary.
Error: /home/me/dev/app/src/components/alert/Alert.tsx(36,7): semantic error TS2742: The inferred type of 'AlertContainer' cannot be named without a reference to '@emotion/serialize/node_modules/csstype'. This is likely not portable. A type annotation is necessary.
Run Code Online (Sandbox Code Playgroud)
错误中引用的代码是:
(typescript) …Run Code Online (Sandbox Code Playgroud)