ThatOpen / engine_web-ifc

Reading and writing IFC files with Javascript, at native speeds.
https://thatopen.github.io/engine_web-ifc/demo
Mozilla Public License 2.0
585 stars 176 forks source link

[Bug]: #914

Closed perstromswe closed 3 weeks ago

perstromswe commented 3 weeks ago

What happened?

Trying to run web-ifc in a react app.

When i run ifcApi.init i get Webassebly-related errors in console.

import * as WebIfc from 'web-ifc';

const App = () => {

  const ifcApi = new WebIfc.IfcAPI();
  ifcApi.Init();

  return (
    <div className="App">
      Test
    </div>
  )
}

export default App

Version

0.0.54

What browsers are you seeing the problem on?

Chrome

Relevant log output

image

Anything else?

Used this template to create the app https://github.com/reduxjs/redux-templates/tree/master/packages/vite-template-redux

beachtom commented 3 weeks ago

So the wasm files should be in your public directory or equivalent. You also need to check that the server is set up to return the wasm mime type for wasm-files.

perstromswe commented 3 weeks ago

Thanks works. Not that obvious. Maybe ad this to quick setup in readme?