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

Missing type definition / interface for standalone bundle #91

Closed
Ketec opened this issue Jun 3, 2022 · 4 comments
Closed

Missing type definition / interface for standalone bundle #91

Ketec opened this issue Jun 3, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Ketec
Copy link

Ketec commented Jun 3, 2022

Error: node_modules/svelte-jsoneditor/components/JSONEditor.svelte.d.ts:37:31 - error TS2304: Cannot find name 'OptionalJSONEditorProps'.

37         updateProps?: (props: OptionalJSONEditorProps) => void;

v 0.3.58

I see it exists in /src/lib/components/JSONEditor.svelte - but not in the bundle installed with npm.

This ends up as a fatal error in strongly typed languages like Angular.

https://stackblitz.com/edit/base-angular-12-app-yvpgys?file=src/app/app.component.ts (fails because the whole definition is not compiling)

For a local copy, I could edit node modules definitions and set these to any to test - it compiles and runs (but with issues in the tree view - like update not refreshing view with new data and clicking in editor after update breaks with update async/undefined error ).

@josdejong josdejong added the bug Something isn't working label Jun 8, 2022
@josdejong
Copy link
Owner

Thanks for reporting. This interface was exported from a Svelte component. Apparently that doesn't work. I've moved the interface to a separate .ts file to solve it.

For a local copy, I could edit node modules definitions and set these to any to test - it compiles and runs (but with issues in the tree view - like update not refreshing view with new data and clicking in editor after update breaks with update async/undefined error ).

Type definitions cannot alter the actual JavaScript behavior, so there is probably an other reason for the issue you mention.

@josdejong
Copy link
Owner

Should be fixed now in v0.3.59

@lucasmaj
Copy link

lucasmaj commented Jul 5, 2022

Still an issue, even with latest version 60 https://stackblitz.com/edit/base-angular-12-app-uss1hg?file=package.json

@josdejong
Copy link
Owner

I did some debugging. The types are there, but right now the types rely on types defined in the svelte package, which is not installed by default. If you install svelte, all works fine. See #19 (comment), help would be welcome to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants