-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Issue with v6.4.1 min build file #187
Comments
Hey @JoeCoppola-HIA , You did well to ask. I added some samples and sandboxes to be sure of what I was releasing, but we can't anticipate everything I've tested the minified builds you refer to on those sandboxes : But I can't notice anything. I've print the code behind Block constructor on npm-package-demo. It is called Maybe one hint, how do you handle dependencies in your project? Especially threejs which is now externalized from three-mesh-ui bundle, so it needs to be loaded it prior to three-mesh-ui. |
Hello Yes there is a major webpack upgrade version 4 to 5. What is your build command please ? A problem with ES15 support ? it's an old issue but .. I didn't find interesting things webpack side. Did you try/can you try a ionic update ? |
Hello @eviltik and @swingingtom, I am currently putting together a codesandbox example from the following minimal reproducing example that mirrors our app environment: https://github.com/JoeCoppola-HIA/SimpleIonicThreeJSApp This repo should be public and accessible to anyone to fork or pulldown and test. Maybe this would help spot anything we might be handling incorrectly. To reproduce, simply I will update this issue with the codesandbox when I have it running as well as try out the suggestions provided already. Thank you for the quick response. Edit: Might have to install ionic as well |
Unfortunately it always happen on fridays... |
Ain't that the truth hahaha. Locking our version to 6.3.2 for the time being has our production issue resolved. But I would hate to miss out on future updates of Three Mesh UI because of this. We will figure it out, that I'm sure of it. Always appreciate your help. |
Well it took me a little longer than I anticipated, but I was able to get an example of the behavior in a codesandbox example. The below link will load a node based sandbox that builds a simple production ionic app, creates a three js scene, places a blue cube and then tries to create a yellow three mesh ui block. On creation attempt it will throw the error I linked above. This will be alerted, and if you hit ok you will see the blue cube but not the yellow block. I also made a sandbox example of the exact same code, but this is building the ionic app without the prod flag, in this example, the error is not thrown: Hopefully this helps spot any issues with the way we handle dependencies here, or how Ionic Angular does. We attempted to update to the latest |
Hey @JoeCoppola-HIA, I was able to reproduce it from the github repository you shared. Issue locationThe resulted issue may not lay on import ThreeMeshUI from "three-mesh-ui/build/three-mesh-ui.module.min";
// which is currenlty the same of
// import ThreeMeshUI from "three-mesh-ui"; and import ThreeMeshUI from "three-mesh-ui/build/three-mesh-ui.module";
// or even the un-built source file
// import ThreeMeshUI from "three-mesh-ui/src/three-mesh-ui"; The produced outputs of Please note, the later didn't suffer from the issue. Workaround - Not AcceptableI was able to get rid of this issue simply by setting import ThreeMeshUI from "three-mesh-ui/build/three-mesh-ui.module.min"; So troubles comes with combination of I did the same process with a webpack repository using terser optimisation, and didn't succeed to reproduce the issue Workaround - Acceptable (IMO)Previous v6.4.1, the So you could get back your imports to : // As the module build will still be optimized from angular side
import ThreeMeshUI from "three-mesh-ui/build/three-mesh-ui.module"; or // Same results as < v6.4.1
import ThreeMeshUI from "three-mesh-ui/src/three-mesh-ui"; Next releases ??Should we revert the Should we downgrade the Both options won't remove the ability of module builds (unminified and minified). |
The build (prod) generate a class calling a constructor without super(). It's BoxComponent. Consider this change: I can't make the test on my side, the idea should be to target ES5 in three-mesh-ui webpack config file using My 2 cents |
Thank you for looking into this. I am glad there are some workarounds that allow us to use the latest and greatest. Tomorrow I can test @eviltik's suggestion of building three mesh UI with the updated target in the config to see if that helps. |
Modifying the browswerConfig in However, updating all our import calls to As for what should be done in future releases, I ran a test to see if downgrading the |
I've update the package.json and pushed a new version v6.4.2 |
Thanks a bunch! We will work on getting this version into our app this week and evaluate any potential issues. |
... as long as you don't break your production on next friday ;) 🪓 🔨 |
hahaha @swingingtom just want to let you know that we upgraded to 6.4.2 in our dev environment. Running with the prod flag work now, and the overall updates I had to make to accommodate the main API changes were pretty straight forward and painless. Thank you a bunch again for this update. I feel more confident about being ready for 7.x.x. |
We are using Ionic version
5.4.16
in tandem with angular version12.1.4
. When building our app in a development environment, we have no issues withv6.4.1
as it directly uses the source files of the node package. However, when we build and deploy our app in a production environment, the minified build file for three mesh UI is used.When we attempt to create a Block component, we get the following reference error:
We have a lot of investigating to still perform, but I was hoping to see if there was any insight into what might be causing this. I noticed that the 6.4 version updates webpack, and was curious if there was a clash there possibly.
I will update this issue as we come across any new information related to this issue.
The text was updated successfully, but these errors were encountered: