Closed benjaminbours closed 2 months ago
Ok I managed to find a hotfix to unlock my situation, in package.json
, I did this change
"module": "build/index.module.js",
I don't know why your package.json
is targetting src/index.js
but you might have your reason.
Let me know if you agree with this fix and I can make a PR if you don't have time for this
Nothing dramatic changed in 0.7.0 - just some file refactoring. Is this something you can reproduce in a new, minimal project? Looking at the code there doesn't seem to be anything wrong and I haven't heard of issues with other bundlers and I don't use nextjs myself.
Let me know if you agree with this fix and I can make a PR if you don't have time for this
I'd prefer not to make this change without understanding why. Importing the original src should be better for some bundlers when it comes to treeshaking and dead code elimination. The index.module.js file is only produced because people have asked for a standalone file to download.
If this can reproduced in a minimal case and it's not looking like the project code is structured incorrectly this may be something worth reporting to nextjs.
"export * as BVHShaderGLSL from './gpu/BVHShaderGLSL.js", it is a syntex error, i think
Describe the bug
I started a project with the version
0.6.8
. Everything was working as expected. When I update to0.7.0
or any superior version, I got this compilation error (I am using nextjs14.1.0
):Which is not true, I checked the files in my
node_modules/three-mesh-bvh
folder and it's of course exported.To Reproduce
Steps to reproduce the behavior:
14.1.0
containing a client side component usingthree-mesh-bvh
version at least0.7.0
Code
Live example
I have not live example yet but could deploy one if it's required. Don't know if it's relevant in that case.
Expected behavior
I would like the lib to load correctly, as it was the case in
0.6.8
while having the update from the last releases.Screenshots
Not relevant, I already printed the error.
Platform:
Additional info
@gkjohnson first, thank you for the great job on this lib! I am currently working on this personal project where your lib is completely key to make it possible => https://dev.compositethegame.com/en | https://github.com/benjaminbours/Composite/tree/level-builder-core-back (If you are not in europe, you will experience high latency) so without your work, it would be much more complicated for me, thank you.
My usage of this lib is probably unconventional, as I am even using it on the backend with NodeJS (there, no import problem with 0.7.0 though) because I have an authoritative server responsible to calculate the physic.
I assume you probably did something between 0.6.8 and 0.7.0 to influence the way the lib is loaded or packaged, do you remember any valuable information to solve this problem?
Thanks in advance,
Benjamin