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

Trouble with Sveltekit 1.0 and TypeScript #29

Open
XrwrX opened this issue Jan 13, 2023 · 2 comments
Open

Trouble with Sveltekit 1.0 and TypeScript #29

XrwrX opened this issue Jan 13, 2023 · 2 comments
Assignees

Comments

@XrwrX
Copy link

XrwrX commented Jan 13, 2023

Hi there, the component looks great, but I'm having trouble getting it working in Sveltekit 1.0 and TypeScript.

Is the Timezone Picker not compatible with TypeScript? Any workaround suggestions? Thank you!

Error on import:
Screenshot 2023-01-13 at 1 59 37 PM

Error on initialization:
Screenshot 2023-01-13 at 2 00 06 PM

@tricinel
Copy link
Owner

Hi @XrwrX! It's indeed not written in Typescript (there was no TS support at the time as far as I remember). I won't have time to rewrite it in the near future, but I think you can do the following to get it working:

In a global.dts or some .dts file in your project, add:

declare module 'svelte-timezone-picker';

Or, alternatively, make use of // @ts-ignore or, better, // @ts-expect-error This should go away when rewritten to TS. I know it's not ideal and I'll keep this issue open for when I have time to move to TS.

Do let me know please if any of the above work for now. Thanks!

@tricinel tricinel self-assigned this Jan 16, 2023
@XrwrX
Copy link
Author

XrwrX commented Jan 16, 2023

declare module 'svelte-timezone-picker';

Adding this to the app.d.ts file did the trick! Many thanks @tricinel :)

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

2 participants