Open tptspe opened 1 year ago
The wasm file you are trying to load has had its import names minified as part of code size optimization. That is why the import its looking for is a.X
and not something more meanful like env.myfunc
.
The JS code that loads this was module is automatically generated by emscripten and embeds these minified names. Perhaps you updated the wasm file without also updating the JS loading code. The JS loaded code (web-ifc-api.js) must match exacltly the wasm file.. they are built together as unit.
@sbc100 Thanks for your taking time with my issue.
Btw, I am not clear howto match the JS loading code with wasm file. Would you explain about it and solution for me again?
Regards.
When you build a wasm file with emscripten it also produces a js file. In your case it looks like that file is called web-ifc-api.js.
If you didn't build that file then the best course of action is probably to find out who did and go to talk to them about your issue.
@sbc100
I didn't build wasm file separate for web-ifc-api.js separately.
I only installed web-ifc-viewer package by following this guide https://github.com/ifcjs/web-ifc-viewer
And I copied wasm files from its source directory from node_modules
folder.
Its folder structure in the node_modules like this.
Let me send msg to web-ifc-viewer team, too. If you have any solution, please update me. Thanks
I have one gatsby.js project to import \*.ifc file and display it in the web browser.
I installed web-ifc-viewer package and copy the 2 files web-ifc.wasm and web-ifc-mt.wasm from its node_modules folder into the component folder, and tried to render sample ifc file but it returns failure.
I also tried to copy 2 wasm files into the public folder, root folder and static folder separately, but got same error.
I created new folder
WebIfcViewer
inside src / components / and add 3 filesHere is the code in the index.tsx.
Here is my package.json.
Behavior and Results:
When I run this, it displays like this screen Rendered UI
If I pick the ifc file called 1.ifc, then it doesn't work and I can see some errors in the browser console. Here is its content.
My working Environment:
Question: How can I resolve this wasm path in gatsby project?