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

[v3.0.0] TypeError: Failed to resolve module specifier "tslib" #193

Closed
heikkilamarko opened this issue Jul 21, 2022 · 6 comments
Closed

Comments

@heikkilamarko
Copy link

heikkilamarko commented Jul 21, 2022

Migrated my SvelteKit app to use "centrifuge": "3.0.0". The Centrifugo server version is v4.

During runtime I get the following error message in the browser console:

Uncaught (in promise) TypeError: Failed to resolve module specifier "tslib". Relative references must start with either "/", "./", or "../".

Here is the error message from Vite:

Screenshot 2022-07-21 at 10 45 29

@FZambia
Copy link
Member

FZambia commented Jul 21, 2022

Hello @heikkilamarko - thanks for report.

Any chance you can try changes in #194 to check whether it fixes an issue?

@heikkilamarko
Copy link
Author

Thanks for the reply. I tried the changes and no longer see the tslib error message. Now I get the following error in browser console:

Screenshot 2022-07-21 at 13 30 46

.

@heikkilamarko
Copy link
Author

heikkilamarko commented Jul 21, 2022

I tried replacing all global statements in build/centrifuge.js with window. After the replace things started to work okay.

@FZambia
Copy link
Member

FZambia commented Jul 21, 2022

I pushed one more commit to use globalThis instead of global. globalThis should refer to window in a browser. Could you try again please?

@heikkilamarko
Copy link
Author

I tried and now it's working okay. Thanks!

@FZambia
Copy link
Member

FZambia commented Jul 21, 2022

Thanks! Just released 3.0.1 with these fixes.

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