Hi !
I got this warning while running my Meteor app with the npm package fluent-ffmpeg. I don't really know what's wrong with this issue because my npm package worked well during more than 3 months. After I installed again all npm packages into my app, i got it.
Unable to resolve some modules:
"./lib-cov/fluent-ffmpeg" in /home/.../MyAPP/node_modules/fluent-ffmpeg/index.js (web.browser)
Unable to resolve some modules:
"./lib-cov/fluent-ffmpeg" in /home/.../MyAPP/node_modules/fluent-ffmpeg/index.js (os.linux.x86_64)
Thank you in advance for any reply
Hey,
This is weird, items in lib-cov should only be referenced during CI. Here is the code from index.js:
module.exports = process.env.FLUENTFFMPEG_COV ? require('./lib-cov/fluent-ffmpeg') : require('./lib/fluent-ffmpeg');
Do you happen to have the environment variable FLUENTFFMPEG_COV set by any chance ? If so, then unsetting it will probably solve the issue.
I exactly have the same code for index.js !
I didn鈥檛 set by myself the environment variable FLUENTFFMPEG_COV. Maybe it has been modified during a process but i don't think.
I am on Ubuntu 14.04 and i work with Meteor ! I tried to remove the npm package and reinstall it but it is same result. I also did npm rebuild
Here is the line related to lib-cov in the makefile :
test/coverage.html: lib-cov
@FLUENTFFMPEG_COV=0 NODE_ENV=test $(MOCHA) --require should --reporter html-cov > test/coverage.html
Hi Jaetoh, I'm having the exact same problem. Are you using webpack by any chance? I think that the issue is because of trying to solve the path statically:
Here is the offending line:
index.js:
module.exports = process.env.FLUENTFFMPEG_COV ? require('./lib-cov/fluent-ffmpeg') : require('./lib/fluent-ffmpeg');
I'm not using webpack ! Did you figure out the warning ?
@Jaetoh this is a Meteor bug. It parses source files and tries to include everything that is in a require() call, even if it's conditional. Nothing fluent-ffmpeg can do here.
Given that webpack has issue resolving this, and that ES6 imports are not done conditionally, is this something you can consider fixing?
I ran into this also when using Webpack as I'm building a desktop app using this library.
The work around (if you are using Webpack):
plugins: [
new webpack.DefinePlugin({
'process.env.FLUENTFFMPEG_COV': false
})
]
If not using Webpack you could just put FLUENTFFMPEG_COV=0 at the start of your npm script.
I'm running into the same problem with https://github.com/electron-userland/electron-builder
New to javascript. I am using react-scripts and running into same issue
I am trying to use kus @kus 's approach
inside
react-scripts/config/webpack.config.dev.js
I can find
plugins: [
new webpack.DefinePlugin(env.stringified)
]
what should I do with it? replace with
plugins: [
new webpack.DefinePlugin({
'process.env.FLUENTFFMPEG_COV': false
})
]?
@Jfeng3 assuming your env.stringified is an Object which it should be, you should check it by adding console.log('env', env.stringified) at the end of your WebPack script and run it to make sure it is. It should equal something like:
{
'process.env.NODE_ENV': 'development'
}
The important thing is it being an Object. If it is; you can inject the new variable in one of the following ways:
_This depends how you are running Webpack, if you get an error like SyntaxError: Unexpected token ... use the next one after._
plugins: [
new webpack.DefinePlugin({
...env.stringified,
'process.env.FLUENTFFMPEG_COV': false
})
]
plugins: [
new webpack.DefinePlugin(Object.assign({}, env.stringified, {'process.env.FLUENTFFMPEG_COV': false}))
]
this is still an issue for me
when i do yarn add fluent-ffmpeg:
WARNING in ./node_modules/electron-debug/index.js 96:45-58
Critical dependency: the request of a dependency is an expression
@ dll renderer
WARNING in ./node_modules/electron-debug/index.js 97:61-74
Critical dependency: the request of a dependency is an expression
@ dll renderer
WARNING in ./node_modules/fluent-ffmpeg/lib/options/misc.js 27:21-40
Critical dependency: the request of a dependency is an expression
@ ./node_modules/fluent-ffmpeg/lib/fluent-ffmpeg.js
@ ./node_modules/fluent-ffmpeg/index.js
@ dll renderer
ERROR in ./node_modules/fluent-ffmpeg/index.js
Module not found: Error: Can't resolve './lib-cov/fluent-ffmpeg' in '/Users/yasgur99/Documents/desktopapp/node_modules/fluent-ffmpeg'
@ ./node_modules/fluent-ffmpeg/index.js 1:48-82
@ dll renderer
Hello all,
Using fluent-ffmpeg, I'm puzzle as to why it would even bother loading lib-cov if it's not included in the npm package anyway.
I am actively looking for alternative solution to get around this, rather than directly modifying your index.js file to get this plugin to work.
Using Angular/Electron build.
I ran into this also when using Webpack as I'm building a desktop app using this library.
The work around (if you are using Webpack):
plugins: [ new webpack.DefinePlugin({ 'process.env.FLUENTFFMPEG_COV': false }) ]If not using Webpack you could just put
FLUENTFFMPEG_COV=0at the start of your npm script.
I am getting same issue in my Vue app, any idea how to solve this.
Does somebody have experience what should to do in a react-app? I tried all offers but nothing works.
Does somebody have experience what should to do in a react-app? I tried all offers but nothing works.
If you are using webpack in react then add this configuration to your plugins object in webpack configuration
```
plugins: [
new webpack.DefinePlugin({
'process.env.FLUENTFFMPEG_COV': false
})
]
I ran into this also when using Webpack as I'm building a desktop app using this library.
The work around (if you are using Webpack):
plugins: [ new webpack.DefinePlugin({ 'process.env.FLUENTFFMPEG_COV': false }) ]If not using Webpack you could just put
FLUENTFFMPEG_COV=0at the start of your npm script.
I think this works for many people but I am using Rollup and it's not working for me. I used the Rollup approach to set the environment variable.
I ran this command but I get the same error:
rollup -c --environment FLUENTFFMPEG_COV:false and also this rollup -c --environment FLUENTFFMPEG_COV:0
@kus do you have any idea why is this not working 馃槩
Most helpful comment
I ran into this also when using Webpack as I'm building a desktop app using this library.
The work around (if you are using Webpack):
If not using Webpack you could just put
FLUENTFFMPEG_COV=0at the start of your npm script.