Build Error - Import from three library fails.

#19 · closed · 3 comments

View on GitHub ↗

pmartin-cogility

**Describe the bug** Building with vite throws this error: ``` ✘ [ERROR] Missing "./build/three.webgpu.js" specifier in "three" package [plugin vite:dep-pre-bundle] node_modules/three-render-objects/dist/three-render-objects.mjs:2:31: 2 │ import { WebGPURenderer } from 'three/build/three.webgpu.js'; ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Rolling back to `v1.39.0` fixes the error. I'll comment here if I learn more.

Comments

vasturiano

Related to the recent PR #18.

samkelleher

Hmm, I also as a consequence of updating another package in my project, [v1.39.1](https://github.com/vasturiano/three-render-objects/releases/tag/v1.39.1) was installed automatically (as I use the lovely react-globe.gl in my project 🌍) as a patch update and now prevents the app from starting. Adding this to my local package.json will resolve the issue ```json "overrides": { "three-render-objects": "1.39.0" } ```

alexandrbig

Hi, The issue here is in the cap "^" before the `three` version. Three does not follow semver for versioning. Thus the cap says to npm/yarn to take the latest minor version which eventually will have breaking changes. Unfortunately caps in `package.json` are used in most of repositories here. And each `yarn install` is so unpredictable. @vasturiano is it possible to replace caps with tildes "~"? More information about caps and tildes: https://stackoverflow.com/questions/22343224/whats-the-difference-between-tilde-and-caret-in-package-json Thank you!