kovacsv / occt-import-js

The emscripten interface for OpenCascade import functionalities.
GNU Lesser General Public License v2.1
141 stars 23 forks source link

occt-import-js for React-JS #7

Closed ThaiLe-gt closed 1 year ago

ThaiLe-gt commented 2 years ago

Hello Kovacsv!! I had an issue when I imported occt-import-js to my react app. Do you have any idea to solve this issue? Thank you in advance! image

kovacsv commented 2 years ago

Can you share the code that references occt-import-js in your app?

ThaiLe-gt commented 2 years ago

Hello Kovacsv!!! I even can not import occt-import-js into my react-app. this is my error for importing. image

kovacsv commented 2 years ago

I'm not familiar with react, but maybe this can help: https://stackoverflow.com/questions/64557638/how-to-polyfill-node-core-modules-in-webpack-5

ThaiLe-gt commented 2 years ago

thank you. let me check it.

npuzl commented 1 year ago

thank you. let me check it.

hello ThaiLe-gt! Have you solved this problem? Can you share some methods?

ThaiLe-gt commented 1 year ago

Hello npuzl! I haven't solved it yet but I switched to nodejs and it worked

jradler65 commented 1 year ago

Hello,

I had the same problem trying to integrate this repo into my React-TS application.

The following Code-Sandbox-Project however helped me realizing it: https://codesandbox.io/s/convert-step-file-to-glb-with-three-js-occt-import-js-v0-3-5hk66o?file=/src/StepLoader.js

Hope this helps anybody searching for a solution.

PS: Regarding the initial questioned error. I think npm i path could fix the problem.

gt2ming commented 11 months ago

Here is my solution, please refer to it.

npm install path-browserify
resolve: {
    fallback: {
        fs: false,
        perf_hooks: false,
        os: false,
        worker_threads: false,
        crypto: false,
        stream: false,
        path: require.resolve('path-browserify'),
    },
},