sgenoud / replicad

The library to build browser based 3D models with code.
https://replicad.xyz
MIT License
392 stars 42 forks source link

init function from replicad_single.js expects 0 arguments #54

Open jirihon opened 2 years ago

jirihon commented 2 years ago

According to https://replicad.xyz/docs/use-as-a-library OpenCascadeInstance should be created by calling the init function exported from replicad-opencascadejs/src/replicad_single.js with single argument (defining locateFile function). However, TypeScript reports Expected 0 arguments, but got 1.. Could you please help me to solve this? I think the type is incorrect in the replicad_single.d.ts as the init function indeed accepts one argument.

paulftw commented 2 years ago

I followed those instructions and it works fine in my project, but I'm not using typescript. Have you tried disabling the typescript checks? if it still doesn't work you may be calling a wrong function. If it does the problem is either in your TS config or project's type annotations. but the former is more likely.

It'd help if you provide a code snippet of what exactly you are calling and what arguments are passed. without that this seems like a question and not yet an issue, so using github discussions would be more appropriate.

sgenoud commented 2 years ago

I have updated the underlying library - can you confirm if it fixes your issue?

jirihon commented 2 years ago

No, it does not fix the issue. The TypeScript definition of the init function is still the same - without any paramater. See https://github.com/sgenoud/replicad/blob/main/packages/replicad-opencascadejs/src/replicad_single.d.ts#L7165 It seems to be a bug in opencascadejs, so I should probably report there.