-
-
Notifications
You must be signed in to change notification settings - Fork 886
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
Circular dependencies warning when using ajv@7.0.3 #1399
Comments
Observed the same issue in a react-native app. I believe it's the I tried patching this but the function cannot easily be extracted into a separate file, it depends on the |
typescript doesn't seem to mind it, probably there is some setting to warn on it... Could you post the full list of circles? Or you have to remove them one by one so it should the next (rather than "and 10 more")? |
I had a short look but do not see a way to have rollup output all circular dependencies instead of the first three and "...and 10 more". One way to reproduce this issue yourself:
I didn't find the time yet to create an isolated demo in an empty project, sorry. Maybe a tool like https://github.com/dependents/node-dependency-tree can be helpful to find the circular dependencies. |
Thanks to all of Git hub team !
На нд, 14.02.2021 г., 11:18 ч. Jos de Jong <notifications@github.com>
написа:
… I had a short look but do not see a way to have rollup output all circular
dependencies instead of the first three and "...and 10 more".
One way to reproduce this issue yourself:
git clone ***@***.***:josdejong/svelte-jsoneditor.git
cd svelte-jsoneditor
npm install
npm start
I didn't find the time yet to create an isolated demo in an empty project,
sorry.
Maybe a tool like https://github.com/dependents/node-dependency-tree can
be helpful to find the circular dependencies.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1399 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHM4IDCVNMXALQVKQQIDAM3S66IOBANCNFSM4WK2DBEA>
.
|
The below three files from node_modules:
const rules_1 = require("../rules");
const applicability_1 = require("./applicability");
const errors_1 = require("../errors");
const codegen_1 = require("../codegen");
const util_1 = require("../util");
const codegen_1 = require("./codegen");
const validate_1 = require("./validate");
const boolSchema_1 = require("./boolSchema");
const dataType_1 = require("./dataType");
const iterate_1 = require("./iterate");
const codegen_1 = require("../codegen");
const names_1 = require("../names");
const resolve_1 = @require("../resolve");
const util_1 = require("../util"); |
这个警告在 webpack 下并不会报出来 This warning will not be reported under webpack onwarn: warning => {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
console.error(`(!) ${warning.message}`);
}
} |
Thanks for sharing this solution to suppress the circular dependency warnings, it works.
I guess that depends: circular dependencies are often a bad thing, so having rollup warn about this may be a good thing 😄 |
Looking into it now. Some circular dependencies are "import type", they are not present in .js files. I was wondering if it's changed since 7.0.3 or is rollup unhappy about circular type dependencies as well? (although errors do point to to .js files). Also, is there some good way to detect them in typescript? I've only found some JS eslint plugin... |
The circular dependencies are really in the JavaScript code. I'm not sure if the TS files contain more circular dependencies.
Just for clarity: I encountered this since upgrading from v6 to v7, not v7.0.3 specific.
I'm not sure, except that rollup seems to be good at this 😉 Using the custom Click to expand all circular dependencies
|
I was hoping to do it with typescript somehow, to avoid adding something like rollup, also rollup doesn't fail when it has cycles - I can probably make it throw exceptions with config but not with CLI. Anyway, it's resolved in v8 branch, I just used |
I can confirm that the circular dependencies are resolved in v8, thanks Evgeny! |
I'm upgrading a library to
ajv@7.0.3
, and rollup gives me the following warning:It is no showstopper, but it would be great if the code would not contain these circular references.
The text was updated successfully, but these errors were encountered: