-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Any type of connection fails when using with next.js. #350
Comments
I'm not familiar with Next.js so I can't tell. I've done a few tests and the latest version does work with other web frameworks such as Vue or even pure JavaScript + HTML though, so it is probably unrelated to the library. And speaking of which, what do your imports look like? See (taken from the documentation): // Unbundled ESM version
import { Innertube } from 'youtubei.js/web'; // Bundled ESM version
import { Innertube } from 'youtubei.js/web.bundle'; // Production Bundled ESM version
import { Innertube } from 'youtubei.js/web.bundle.min'; |
I'm importing like this import { Innertube } from "youtubei.js"; Is there any documentation about the different imports? When should I use one or the other? |
@titong0 if next.js is anything like webpack, it's picking the node.js import instead of the web one, despite the output target being a web browser, so you can use one of the 3 above to force it to use a web one. |
The problem is, nextjs runs on both server and client. In my case its only running on the server so I think a node.js version would actually be ideal? |
In case this happened to anyone. Running |
After updating to V3.3.0, I'm getting multiple crashes for any code that uses the library, even
The error I'm getting looks like this:
I don't know wether this is a next.js thing but it wasn't happening before updating to 3.3.0.
Originally posted by @titong0 in #279 (comment)
The text was updated successfully, but these errors were encountered: