【问题标题】:Import Error with @react-three/fiber / @react-three/drei@react-three/fiber / @react-three/drei 的导入错误
【发布时间】:2022-01-25 15:11:51
【问题描述】:

我正在尝试使用来自@react-three/drei 的一些组件,它给了我大量的导入错误。无论我尝试从@react-three/drei 使用什么,我都会收到这些错误。 示例:

ERROR in ./node_modules/three-stdlib/loaders/EXRLoader.js 1703:52-62
export 'RGBEFormat' (imported as 'RGBEFormat') was not found in 'three'

另一个例子:

export 'RGBEEncoding' (imported as 'RGBEEncoding') was not found in 'three'

这些是项目的依赖项:

    "@react-three/drei": "^8.3.1",
    "@react-three/fiber": "^7.0.24",
    "@testing-library/jest-dom": "^5.16.1",
    "@testing-library/react": "^12.1.2",
    "@testing-library/user-event": "^13.5.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "5.0.0",
    "three": "^0.136.0",
    "three-stdlib": "^2.6.2",
    "web-vitals": "^2.1.2"

感谢您的帮助并提前致谢!

【问题讨论】:

    标签: reactjs three.js react-three-fiber react-fiber drei


    【解决方案1】:

    Three.js migration guide 表示“RGBEEncoding 和 RGBEFormat 已被删除”。从 136.
    尝试改用 135。

    【讨论】:

    • 谢谢!我为这个问题发疯了好几个小时哈哈。
    猜你喜欢
    • 1970-01-01
    • 2021-07-02
    • 1970-01-01
    • 1970-01-01
    • 2022-12-15
    • 2021-12-23
    • 2020-10-31
    • 1970-01-01
    • 2023-02-01
    相关资源
    最近更新 更多