Skip to content

No matching export in "node_modules/three/build/three.module.js" for import "sRGBEncoding" #35

@Bunkerbewohner

Description

@Bunkerbewohner

Hi!

First of all, amazing library you created here! Great work!
I want to play around with it a bit, but I'm having issues,
I'm using these dependencies:

"devDependencies": {
    "@types/react-dom": "^18.2.25",
    "@types/three": "^0.164.0",
    "typescript": "^5.4.5"
  },
  "dependencies": {
    "@react-three/drei": "^9.105.4",
    "@react-three/fiber": "^8.16.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "three": "^0.164.1",
    "three-landscape": "^0.9.2",
    "vite": "^5.2.10"
  },

But vite is throwing errors when trying to import the library:

 No matching export in "node_modules/three/build/three.module.js" for import "sRGBEncoding"

    node_modules/three-landscape/dist/util/generateTextureArray.js:1:114:
      1 │ ...at, UnsignedByteType, LinearMipMapLinearFilter, NearestFilter, RepeatWrapping, sRGBEncoding } from "three";
        ╵       

No matching export in "node_modules/three/build/three.module.js" for import "sRGBEncoding"

    node_modules/three-landscape/dist/util/util.js:69:67:
      69 │ import { RepeatWrapping, NearestFilter, LinearMipmapNearestFilter, sRGBEncoding } from "three";

It looks like maybe THREE renamend sRGBEncoding to sRGBColorSpace and the encoding property on textures to colorSpace.

I guess the way to fix this is upgrading the dependencies of the library and making use of those new names, right?
Well, I'll give it a try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions