【发布时间】:2021-02-25 17:44:45
【问题描述】:
我最近用 Gatsby 创建了一个项目。当我尝试使用 @emotion/core 和 @emotion/styled 时,它显示了一个错误。
请参阅有关调试 HTML 构建的文档页面以获取帮助 https://gatsby.dev/debug-html
@emotion/core包已重命名为@emotion/react。请像这样导入它import { jsx } from '@emotion/react'。
2 |
3 | throw new Error("
@emotion/core包已重命名为@emotion/react。请像这样导入它import { jsx } from '@emotion/react'。"); | ^ 4 |
WebpackError:@emotion/core 包已重命名为 @emotion/react。请像这样导入它import { jsx } from '@emotion/react'。
-
emotion-core.cjs.dev.js:3 node_modules/@emotion/core/dist/emotion-core.cjs.dev.js:3:1
-
情感核心.cjs.js:6 node_modules/@emotion/core/dist/emotion-core.cjs.js:6:20
-
gatsby-ssr.js:9 node_modules/gatsby-plugin-manifest/gatsby-ssr.js:9:15
enter code here
我已经将它重命名并导入,因为它在那里显示。我也尝试使用 Gatsby clean 并删除 node_modules 并重新安装,但仍然出现错误。感谢您的帮助。
【问题讨论】: