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

Require cycle: node_modules/axios/lib/defaults.js #4177

Closed
detroit007 opened this issue Oct 12, 2021 · 31 comments
Closed

Require cycle: node_modules/axios/lib/defaults.js #4177

detroit007 opened this issue Oct 12, 2021 · 31 comments

Comments

@detroit007
Copy link

detroit007 commented Oct 12, 2021

Describe the bug

Require cycle: node_modules/axios/lib/defaults.js -> node_modules/axios/lib/adapters/xhr.js -> node_modules/axios/lib/defaults.js

To Reproduce

update the axios to latest version 0.22.0 and the warning occur

Environment

  • Axios Version 0.22.0

Screen Shot 2021-10-12 at 6 14 34 PM

how to remove this warning? It came every time I refresh.

@detroit007
Copy link
Author

@jasonsaayman any help would be appreciated. Thanks

@jasonsaayman
Copy link
Member

Please try with 0.23

@detroit007
Copy link
Author

@jasonsaayman I've upgraded to 0.23 and the warning is still there.

@rosendolu
Copy link

rosendolu commented Oct 14, 2021

@jasonsaayman Same question with 0.23.0

(!) Circular dependencies
node_modules/axios/lib/defaults.js -> node_modules/axios/lib/adapters/xhr.js -> node_modules/axios/lib/defaults.js
node_modules/axios/lib/defaults.js -> node_modules/axios/lib/adapters/http.js -> node_modules/axios/lib/defaults.js

0.21.4 works fine

@jimpo
Copy link

jimpo commented Oct 20, 2021

I'm running into the same circular import using rollup. Looks like it's the requires in getDefaultAdapter().

@thomaschampagne
Copy link

Same here

@thomaschampagne
Copy link

Using RollupJS

image

@razr130
Copy link

razr130 commented Oct 26, 2021

is there any fix to this yet? I run into the same warning

@jasonsaayman
Copy link
Member

Is this only when using rollup?

@maullerz
Copy link

Warning also exists in Metro for react-native

@maullerz
Copy link

maullerz commented Oct 26, 2021

I think it appeared in v0.22
76f09af
Screenshot 2021-10-26 at 10 36 07

Looks like this warning can be ignored - defaults needed only for that line
var transitional = config.transitional || defaults.transitional;

Anyway it is annoying and can lead to uninitialized values.

@DigitalBrainJS
Copy link
Collaborator

These are just warnings, not errors, and since all cross-references are properly initialized, they can be ignored. But anyway #4220

@thomaschampagne
Copy link

Good news if this can be fixed !

@nurulamelia2
Copy link

Sorry, can you tell me, how do I update that version?

@musanpras
Copy link

I think it appeared in v0.22 76f09af Screenshot 2021-10-26 at 10 36 07

Looks like this warning can be ignored - defaults needed only for that line var transitional = config.transitional || defaults.transitional;

Anyway it is annoying and can lead to uninitialized values.

just comment this line
var defaults = require('../defaults')

@LeandroS4nt0s
Copy link

just comment the require('defaults') at node_modules/axios/lib/defaults.js and this line var transitional = config.transitional || defaults.transitional;

@thomaschampagne
Copy link

Any status on this?

@DevChrisRoth
Copy link

Try axios Version 0.21.4.

@Arifursdev
Copy link

😫

@cumironin
Copy link

v 0.21.4 still not working on svelte or the newer

@jasonsaayman
Copy link
Member

Pull request by @DigitalBrainJS has been merged, this will be in the new release

@uyscuti513
Copy link

Pull request by @DigitalBrainJS has been merged, this will be in the new release

which version? Currently I am using "axios": "^0.26.0", but Still remain that problem...

How can I fix this problem?

image

@jasonsaayman
Copy link
Member

This will be in v1, the current version that is being worked on

@uyscuti513
Copy link

Can I send package.json file. Currently I am working with latest version.
image

@wjaykim
Copy link

wjaykim commented Mar 8, 2022

@Marko0513 He means the version is not released yet.

@uyscuti513
Copy link

Ok, @wjaykim got it.

@jasonsaayman
Copy link
Member

I will try release a minor version with this in this week

@uyscuti513
Copy link

Hello, @jasonsaayman
Can I get any news for your fixing the warning? It's same yet.
image

@TomK
Copy link

TomK commented Mar 14, 2022

@Marko0513 you need to use https://github.com/axios/axios/releases/tag/v0.26.1

@uyscuti513
Copy link

okay, really thanks for notify, can I install with npm or I will download the module with manual?

@jasonsaayman
Copy link
Member

jasonsaayman commented Mar 14, 2022

@Marko0513 can be installed via npm

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