Closed AntonyM71 closed 2 years ago
This same message is a warning in our webpack build. We do not use create-react-app
. The warning has been present ever since we introduced this dependency. The warning has bothered me but the benefits of the library were worth it. It would be nice to see this warning resolved.
WARNING in ./node_modules/yargs-parser/build/index.cjs 1021:19-32 Critical dependency: the request of a dependency is an expression @ ./node_modules/convict/src/main.js 9:18-41
As described in my earlier comment, I am seeing this message as a warning in my webpack build.
While searching for a solution, I found mention of setting CI=false
as a solution for preventing these warnings from being treated as errors, which may help you @AntonyM71 .
Hello, we have a big react app and receive the same error, when we try upgrading from convict: 6.0.0
to 6.2.2
:
TypeError: parseArgs is not a function
at importArguments ([...]/repo/node_modules/convict/src/main.js:332:16)
at convict ([...]/repo/node_modules/convict/src/main.js:717:3)
Adding CI=false
to the process didn't help. Any other ideas?
We could fix the issue.
In our jest.preset.js
we have some transformations configured and in the transformIgnorePatterns
, the file ending cjs
was missing. Because of that it was transforming the .cjs
files from yargs-parser
and convict
failed to use those files during the test runs.
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { rootMode: 'upward' }],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': 'jest-transform-stub',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(cjs|js|jsx|ts|tsx)$']
Thanks @c-sauerborn :+1:
Closing this ticket as this is not a convict problem.
I receive the following error when trying to use Convict in my create-react-app application. It appears to be related to how convict imports parseArgs from
yarns-parser
In my terminal, the following message is displayed:
Here is my package.json