SavageCore / node-ffprobe-installer

Platform independent binary installer of FFprobe for node projects
https://www.npmjs.com/package/@ffprobe-installer/ffprobe
72 stars 29 forks source link

Critical dependency: the request of a dependency is an expression #230

Closed kalashnikovisme closed 1 year ago

kalashnikovisme commented 1 year ago

https://github.com/caffco/get-video-duration depends on ffprobe-installer. Getting this warning after adding get-video-duration package to my project.

webpacker_1      | WARNING in ./node_modules/@ffprobe-installer/ffprobe/index.js 33:16-36
webpacker_1      | Critical dependency: the request of a dependency is an expression
webpacker_1      |     at CommonJsRequireContextDependency.getWarnings (/usr/src/app/node_modules/webpack/lib/dependencies/ContextDependency.js:40:18)
webpacker_1      |     at Compilation.reportDependencyErrorsAndWarnings (/usr/src/app/node_modules/webpack/lib/Compilation.js:1454:24)
webpacker_1      |     at /usr/src/app/node_modules/webpack/lib/Compilation.js:1258:10
webpacker_1      |     at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/src/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:20:1)
webpacker_1      |     at AsyncSeriesHook.lazyCompileHook (/usr/src/app/node_modules/tapable/lib/Hook.js:154:20)
webpacker_1      |     at Compilation.finish (/usr/src/app/node_modules/webpack/lib/Compilation.js:1253:28)
webpacker_1      |     at /usr/src/app/node_modules/webpack/lib/Compiler.js:672:17
webpacker_1      |     at _done (eval at create (/usr/src/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
webpacker_1      |     at eval (eval at create (/usr/src/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:30:22)
webpacker_1      |     at /usr/src/app/node_modules/webpack/lib/Compilation.js:1185:12
webpacker_1      |     at /usr/src/app/node_modules/webpack/lib/Compilation.js:1097:9
webpacker_1      |     at processTicksAndRejections (internal/process/task_queues.js:79:11)

Looks like the reason of this error is in ffprobe-installer

Also I have this error in browser console

Uncaught Error: Unsupported platform/architecture: browser-javascript
    at Object.<anonymous> (index.js:15:1)
    at ./node_modules/@ffprobe-installer/ffprobe/index.js (index.js:44:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./node_modules/get-video-duration/dist/es6/index.js (index.js:44:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./app/javascript/components/common/VideoUploader/VideoUploader.vue?vue&type=script&lang=js& (VideoUploader.vue:31:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./app/javascript/components/common/VideoUploader/VideoUploader.vue?vue&type=script&lang=js& (VideoUploader.vue?fd85:1:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./app/javascript/components/common/VideoUploader/VideoUploader.vue (VideoUploader.vue:1:1)

Environment:

I'm looking for a reason, but I would be great to have a little assist.

kalashnikovisme commented 1 year ago

Figured out that ffprobe-installer installs ffmpeg. Looks like it can't be used in a browser, it's only for NodeJS. Unfortunately, get-video-duration package does not have info about platforms.

Closing it.