three-landscape icon indicating copy to clipboard operation
three-landscape copied to clipboard

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

Open Bunkerbewohner opened this issue 10 months ago • 1 comments

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.

Bunkerbewohner avatar Apr 27 '24 11:04 Bunkerbewohner