replicad icon indicating copy to clipboard operation
replicad copied to clipboard

init function from replicad_single.js expects 0 arguments

Open jirihon opened this issue 3 years ago • 3 comments

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.

jirihon avatar Jul 27 '22 09:07 jirihon

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.

paulftw avatar Jul 28 '22 13:07 paulftw

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

sgenoud avatar Aug 09 '22 08:08 sgenoud

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.

jirihon avatar Aug 10 '22 06:08 jirihon