ANGULAR __name is not defined #3190
-
Hi there ! https://showcase.test.divelitalia.it/it/products/sole/fashion/glamourmask/viewer Uncaught ReferenceError: __name is not defined The error occurs inside the /* worker */ javascript. The most suspicious thing is that locally I can successfully compile the project with test environment and serving generated files works without any problem. The only relevat change I made recently is that I migrated my Jenkins to arm64 architecture. The version I am using is this Please help, I really dunno what is happening here. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I confirm it's not related to arm64 architecture compiling the project. |
Beta Was this translation helpful? Give feedback.
-
I found out what caused the issue. The breaking change, maybe, was the migration to angular 13 we also did a month ago, and enabling ivy compiler. So here is the summary NOT WORKING: WORKING |
Beta Was this translation helpful? Give feedback.
I found out what caused the issue.
The issue is related to a specific gltf requiring a draco functionality.
This triggers the library to use DRACOLoader.js from three-js.
In this scenario, the ONLY WAY I found to use @google/model-viewer in an angular project is to copy model-viewer.min.js into assets folder inside angular.json, and import it from assets folder in index.html (or you can use the remote import directly in index.html).
In any other way the DRACOWorker declaration is changed by angular compiler at compilation time and __name error is triggered.
The breaking change, maybe, was the migration to angular 13 we also did a month ago, and enabling ivy compiler.
I am not sure why it …