engine_components icon indicating copy to clipboard operation
engine_components copied to clipboard

Incorrect imports

Open thomasrenger opened this issue 1 year ago • 1 comments

Describe the bug 📝

You are using incorrect imports by importing types not from module but from source

import { generateUUID } from "three/src/math/MathUtils";

In this case three decided to provide the functions by MathUtils

Could you please update your code?

Example:

import { MathUtils } from 'three';

console.log(MathUtils.generateUUID());

Reproduction ▶️

No response

Steps to reproduce 🔢

No response

System Info 💻

System:
    OS: macOS 14.4.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 49.34 MB / 128.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  Browsers:
    Chrome: 119.0.6045.105
    Edge: 124.0.2478.51
    Safari: 17.4.1
  npmPackages:
    openbim-components: ^1.4.21 => 1.4.21

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • [X] Check that this is a concrete bug. For Q&A join our Community.
  • [X] The provided reproduction is a minimal reproducible example of the bug.

thomasrenger avatar Apr 19 '24 11:04 thomasrenger

I cannot build a bundle using rollup and i guess it comes from this bug :

[!] Error: Could not load C:\Users\rvouillo\Documents\GitHub\uebim24-debug\node_modules\three\src\math\MathUtils (imported by node_modules/openbim-components/src/navigation/ViewpointsManager/index.js): ENOENT: no such file or directory, open 'C:\Users\rvouillo\Documents\GitHub\uebim24-debug\node_modules\three\src\math\MathUtils'
Error: Could not load C:\Users\rvouillo\Documents\GitHub\uebim24-debug\node_modules\three\src\math\MathUtils (imported by node_modules/openbim-components/src/navigation/ViewpointsManager/index.js): ENOENT: no such file or directory, open 'C:\Users\rvouillo\Documents\GitHub\uebim24-debug\node_modules\three\src\math\MathUtils'

Do you have a way to bypass this?

Edit : i could bypass using Vite

rvouilloz avatar Apr 29 '24 13:04 rvouilloz

Solved! Let us know otherwise. Also, all our libraries are bundled now, so using them should be easier. Cheers!

agviegas avatar Jun 20 '24 21:06 agviegas