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

[BUG] Cannot read properties of undefined (reading 'match') #2988

Open
wes1993 opened this issue Oct 7, 2024 · 6 comments
Open

[BUG] Cannot read properties of undefined (reading 'match') #2988

wes1993 opened this issue Oct 7, 2024 · 6 comments

Comments

@wes1993
Copy link

wes1993 commented Oct 7, 2024

Describe the Bug

When search somethig the error "Cannot read properties of undefined (reading 'match')" appear.
I have see that chosing in filter some value make the search working again

Steps to Reproduce the Bug

  1. Search Something
  2. Click enter

Expected Behaviour

Should search using some predefined filter, example all

Screenshot/Screen recording

image

Device Info

  • Device: PC
  • OS: Windows 11
  • Browser: Chrome
  • Version: 129.0.6668.90

Additional Context

@gareins
Copy link

gareins commented Oct 18, 2024

This generates errors in logs:

viewtube-main       | [ViewTube] 1      - 10/18/2024, 11:23:06 AM   ERROR [ExceptionsHandler] Package subpath './dist/protos/generated/misc/params' is not defined by "exports" in /home/app/server/node_modules/youtubei.js/package.json - {"stack":["Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/protos/generated/misc/params' is not defined by \"exports\" in /home/app/server/node_modules/youtubei.js/package.json\n    at exportsNotFound (node:internal/modules/esm/resolve:304:10)\n    at packageExportsResolve (node:internal/modules/esm/resolve:651:9)\n    at resolveExports (node:internal/modules/cjs/loader:634:36)\n    at Module._findPath (node:internal/modules/cjs/loader:724:31)\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)\n    at Module._load (node:internal/modules/cjs/loader:1051:27)\n    at Module.require (node:internal/modules/cjs/loader:1311:19)\n    at require (node:internal/modules/helpers:179:18)\n    at /home/app/server/dist/core/search/search.service.js:80:229\n    at async SearchService.getSearch (/home/app/server/dist/core/search/search.service.js:80:156)"]}
viewtube-main       | [ViewTube] 1      - 10/18/2024, 11:23:06 AM   ERROR [ExceptionsHandler] Package subpath './dist/protos/generated/misc/params' is not defined by "exports" in /home/app/server/node_modules/youtubei.js/package.json - {"stack":["Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/protos/generated/misc/params' is not defined by \"exports\" in /home/app/server/node_modules/youtubei.js/package.json\n    at exportsNotFound (node:internal/modules/esm/resolve:304:10)\n    at packageExportsResolve (node:internal/modules/esm/resolve:651:9)\n    at resolveExports (node:internal/modules/cjs/loader:634:36)\n    at Module._findPath (node:internal/modules/cjs/loader:724:31)\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1211:27)\n    at Module._load (node:internal/modules/cjs/loader:1051:27)\n    at Module.require (node:internal/modules/cjs/loader:1311:19)\n    at require (node:internal/modules/helpers:179:18)\n    at /home/app/server/dist/core/search/search.service.js:80:229\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"]}

@gareins
Copy link

gareins commented Oct 18, 2024

Seems like there was some proto generation changed in 10.0.4 -> 10.0.5 of youtubei.js dependency: LuanRT/YouTube.js@94bc596

Then two weeks ago in 8979b7a it looks to me like @moisout somehow used code from those generated files, but the code does not seem to be exported by the dependency. I have no idea how this crazy ts/js build world works, but I'll dig on to see if I can get to the root problem here.

Also later in 44606cf some fixes were made to import stuff at runtime.

@wes1993
Copy link
Author

wes1993 commented Oct 19, 2024

@gareins Thanks a lot for your reply!!!

@gareins
Copy link

gareins commented Oct 21, 2024

I have now managed to reproduce this. I had removed the code changes in last two commits and comments on videos now load and I get this same match error. Just to paste the whole error from the instance:

viewtube-main       | [ViewTube] 1      - 10/21/2024, 11:18:53 AM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'match') - {"stack":["TypeError: Cannot read properties of undefined (reading 'match')\n    at parseAccessibilityDuration (/home/app/server/dist/mapper/utils/accessibility-duration.js:12:53)\n    at extractSearchShort (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:104:76)\n    at /home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:93:41\n    at Proxy.map (<anonymous>)\n    at extractSearchShortsShelf (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:93:29)\n    at /home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:28:24\n    at Proxy.map (<anonymous>)\n    at extractSearchResults (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:19:27)\n    at toVTSearchResultDto (/home/app/server/dist/mapper/converter/search/vt-search-result.converter.js:14:69)\n    at SearchService.getSearch (/home/app/server/dist/core/search/search.service.js:60:65)"]}
viewtube-main       | [ViewTube] 1      - 10/21/2024, 11:18:54 AM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'match') - {"stack":["TypeError: Cannot read properties of undefined (reading 'match')\n    at parseAccessibilityDuration (/home/app/server/dist/mapper/utils/accessibility-duration.js:12:53)\n    at extractSearchShort (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:104:76)\n    at /home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:93:41\n    at Proxy.map (<anonymous>)\n    at extractSearchShortsShelf (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:93:29)\n    at /home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:28:24\n    at Proxy.map (<anonymous>)\n    at extractSearchResults (/home/app/server/dist/mapper/converter/search/vt-search-result.extractors.js:19:27)\n    at toVTSearchResultDto (/home/app/server/dist/mapper/converter/search/vt-search-result.converter.js:14:69)\n    at SearchService.getSearch (/home/app/server/dist/core/search/search.service.js:60:65)"]}

Will look into it now.

@LordS4me
Copy link

Any news on this ?

@engynious
Copy link

Also piggy-backing this issue.

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

4 participants