Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init function from replicad_single.js expects 0 arguments #54

Open
jirihon opened this issue Jul 27, 2022 · 3 comments
Open

init function from replicad_single.js expects 0 arguments #54

jirihon opened this issue Jul 27, 2022 · 3 comments

Comments

@jirihon
Copy link

jirihon commented Jul 27, 2022

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
Copy link
Contributor

paulftw commented Jul 28, 2022

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
Copy link
Owner

sgenoud commented Aug 9, 2022

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

@jirihon
Copy link
Author

jirihon commented Aug 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants