-
-
Notifications
You must be signed in to change notification settings - Fork 971
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
global is not defined (SvelteKit/Vite) #883
Comments
I also tried |
The issue seems to be in the |
My solution was to just add the |
Got the same issue |
I did |
@Swepool Your trick didn't work for me. It stopped the
|
Any solution for this so far? |
How do you get this script file? |
It's in the repo https://github.com/feross/simple-peer/blob/master/simplepeer.min.js |
This worked for me: import SimplePeer from 'simple-peer/simplepeer.min.js' |
In short, when using Vite, this is the fix until this gets properly addressed. In your vite.config.ts, add a resolve: {
alias: {
// ...
"simple-peer": "simple-peer/simplepeer.min.js",
},
}, |
It worked elegantly. Thx : ) |
The text was updated successfully, but these errors were encountered: