You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an almost empty project (I have three.js and parcel as dependencies), for some reason Three JS objects lose some of their fields in development mode. I noticed that some methods from WebGLRenderer, for instance, such as setAnimationLoop doesn't exist (it works only in generated bundles)
I don't have any kind of babel config or anything else. And although I saw this behaviour in Three.JS it may happen with other dependencies I guess.
Please let me know if I can help with any more information and if you can guide me through some way on fixing it myself.
馃 Expected Behavior
Their small "hello world" example should work just fine without any workarounds, as it does in builded version, without "omitting" any of their properties and methods
馃槸 Current Behavior
Lots of Three.js objects fields just "disappear". I made a small diff of some properties that were "lost" in development for WebGLRenderer as an example. The array below contain all missing properties.
In builded bundles it works just fine and keeps all original fields
Update:
The issue stopped and came back in some iterations but was mostly happening. Tested with Chrome, Firefox and Safari
馃拋 Possible Solution
I have no clue so far about what might be causing it and if is it really a Parcel issue, but I am willing to help if I am able to. It seems related to the same issue in #5138. I also gave a look at some three js implementations of some of these fields that "disappear" when using Parcel and it really doesn't seems to be something on their side.
import*asTHREEfrom"three";letcamera,scene,renderer;letgeometry,material,mesh;init();functioninit(){camera=newTHREE.PerspectiveCamera(70,window.innerWidth/window.innerHeight,0.01,10);camera.position.z=1;scene=newTHREE.Scene();geometry=newTHREE.BoxGeometry(0.2,0.2,0.2);material=newTHREE.MeshNormalMaterial();mesh=newTHREE.Mesh(geometry,material);scene.add(mesh);renderer=newTHREE.WebGLRenderer({antialias: true});renderer.setSize(window.innerWidth,window.innerHeight);renderer.setAnimationLoop(animation);// -> Propert "doesn' exists" only when using Parcel in development serverdocument.body.appendChild(renderer.domElement);}functionanimation(time){mesh.rotation.x=time/2000;mesh.rotation.y=time/1000;renderer.render(scene,camera);}
Given the above and having both three.js and parcel, one may run yarn parcel index.html to replicate this issue
馃實 Your Environment
Software
Version(s)
Parcel
2.2.0
Node
14.18.2
npm/Yarn
1.22.15
Operating System
macOS
The text was updated successfully, but these errors were encountered:
馃悰 bug report
Given an almost empty project (I have three.js and parcel as dependencies), for some reason Three JS objects lose some of their fields in development mode. I noticed that some methods from
WebGLRenderer
, for instance, such assetAnimationLoop
doesn't exist (it works only in generated bundles)I don't have any kind of babel config or anything else. And although I saw this behaviour in Three.JS it may happen with other dependencies I guess.
Please let me know if I can help with any more information and if you can guide me through some way on fixing it myself.
馃 Expected Behavior
Their small "hello world" example should work just fine without any workarounds, as it does in builded version, without "omitting" any of their properties and methods
馃槸 Current Behavior
Lots of Three.js objects fields just "disappear". I made a small diff of some properties that were "lost" in development for
WebGLRenderer
as an example. The array below contain all missing properties.In builded bundles it works just fine and keeps all original fields
Update:
The issue stopped and came back in some iterations but was mostly happening. Tested with Chrome, Firefox and Safari
馃拋 Possible Solution
I have no clue so far about what might be causing it and if is it really a Parcel issue, but I am willing to help if I am able to. It seems related to the same issue in #5138. I also gave a look at some three js implementations of some of these fields that "disappear" when using Parcel and it really doesn't seems to be something on their side.
馃捇 Code Sample
Given the above and having both three.js and parcel, one may run
yarn parcel index.html
to replicate this issue馃實 Your Environment
The text was updated successfully, but these errors were encountered: