yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

Home Page:https://yomotsu.github.io/camera-controls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid "main" entry in v2.8.x

AER-Quinten opened this issue · comments

The package.json sets the main entry to dist/camera-controls.js which was changed into dist/camera-controls.module.js in 89cad76

"main": "dist/camera-controls.js",

This causes our project with @react-three/drei to fail during build.

I'm having the same issue

I'm also having the same issue.

We also ran into the same issue with @react-three/drei@^9.96.5. As a temporary solution you can add the following resolution to your package.json:

  "resolutions": {
    "camera-controls": "2.7.4"
  }

*This is most likely related to v2.7.4...v2.8.0#diff-47407fecafdf5f5cd55403c3de457833ddf9b6fab45253c04e1dc4c7cb4495b1L17, from yesterday's [v2.8.0](https://github.com/yomotsu/camera-controls/releases/tag/v2.8.0) changelog:

Drop support for UMD, add module.min.js (89cad76)

Very sorry for the problem, and thanks for pointing it out.
I fixed it with #482 and v2.8.2 has been published.

(Do we still need UMD or CJS as well...?

(Do we still need UMD or CJS as well...?

Seems like @react-three/drei builds to CJS and tries to import your package using require, which throws a syntax error. My guess is that CJS will be required for drei to work, I don't know if there are any other CJS packages that depend on yours that have the same issue.

(Do we still need UMD or CJS as well...?

I'm using @react-three/drei v9.80.3 and getting build errors after the v2.8.2 update. having trouble with the require syntax, and I think need CJS support.

Thanks, I added CJS as main in package.json.
https://github.com/yomotsu/camera-controls/releases/tag/v2.8.3

Looks good now?

Looks good now?

Build succeeded. Thanks!

Looks good now?

it works good. thanks!