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

6.0.0 Error: ENOENT: no such file or directory #475

Closed
4 tasks done
AdelDima opened this issue Aug 22, 2023 · 3 comments
Closed
4 tasks done

6.0.0 Error: ENOENT: no such file or directory #475

AdelDima opened this issue Aug 22, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@AdelDima
Copy link

AdelDima commented Aug 22, 2023

Steps to reproduce

Hello, I'm using youtubei.js 6.0.0 on Nextjs project https://github.com/AdelDima/youtube-to-notion
Locally it works just fine but in Vercel deploy ( with yarn and npnm ) I get this error:

Error: ENOENT: no such file or directory, open 
'/vercel/path0/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/dist/package.json'

Full error:

The app is live any help will be appreciated

Failure Logs

Error: ENOENT: no such file or directory, open '/vercel/path0/node_modules/youtubei.js/dist/package.json'
    at Object.openSync (node:fs:601:3)
    at readFileSync (node:fs:469:35)
    at 65480 (/var/task/.next/server/chunks/480.js:50553:62)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at 47909 (/var/task/.next/server/app/api/youtube/get-playlist/route.js:209:12)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at __webpack_exec__ (/var/task/.next/server/app/api/youtube/get-playlist/route.js:276:39)
    at /var/task/.next/server/app/api/youtube/get-playlist/route.js:277:78
    at __webpack_require__.X (/var/task/.next/server/webpack-runtime.js:138:21)
    at /var/task/.next/server/app/api/youtube/get-playlist/route.js:277:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/vercel/path0/node_modules/youtubei.js/dist/package.json',
  page: '/api/youtube/get-playlist'
}
Error: ENOENT: no such file or directory, open '/vercel/path0/node_modules/youtubei.js/dist/package.json'
    at Object.openSync (node:fs:601:3)
    at readFileSync (node:fs:469:35)
    at 65480 (/var/task/.next/server/chunks/480.js:50553:62)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at 47909 (/var/task/.next/server/app/api/youtube/get-playlist/route.js:209:12)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at __webpack_exec__ (/var/task/.next/server/app/api/youtube/get-playlist/route.js:276:39)
    at /var/task/.next/server/app/api/youtube/get-playlist/route.js:277:78
    at __webpack_require__.X (/var/task/.next/server/webpack-runtime.js:138:21)
    at /var/task/.next/server/app/api/youtube/get-playlist/route.js:277:47 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/vercel/path0/node_modules/youtubei.js/dist/package.json',
  page: '/api/youtube/get-playlist'
}
RequestId: 65ff7569-793f-42b8-9f33-1fe5e1fd33c9 Error: Runtime exited with error: exit status 1
Runtime.ExitError

Expected behavior

Expect the API to return the playlist with a POST request

Current behavior

Error 405 on the browser and 500 on Vercel because of this error:

Error: ENOENT: no such file or directory, open 
'/vercel/path0/node_modules/.pnpm/[email protected]/node_modules/youtubei.js/dist/package.json'

Version

Default

Anything else?

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@AdelDima AdelDima added the bug Something isn't working label Aug 22, 2023
@LuanRT
Copy link
Owner

LuanRT commented Aug 22, 2023

When did this start happening? Is it exclusive to v6.x.x or are you able to replicate it with previous versions as well?

@LuanRT
Copy link
Owner

LuanRT commented Aug 22, 2023

A clean install (deleting your node_modules or doing npm clean-install) can probably fix that, but I'm not sure though.

Or maybe you are not importing the library correctly? We have exports for web, node and agnostic for other environments.

@AdelDima
Copy link
Author

A clean install (deleting your node_modules or doing npm clean-install) can probably fix that, but I'm not sure though.

I just find a solution #350 (comment)

Fixed by using web version

import { Innertube } from 'youtubei.js/web'

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

2 participants