Replies: 2 comments
-
The issue is caused by axios ^1.0.0; I solved the issue by downgrading to "axios": "0.27.2" Related issue: axios/axios#5292 Update: I found a solution using craco: #11889 (comment). That allowed me to solve the issue without downgrading |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is caused by cra treating cjs module dependencies as assets so not bundling them correctly. There are a could of old PRs against cra to fix, such as #12021. I was able to work around it using react-app-rewired based on #12021 (comment). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have created a custom javascript library called
Domain
and we are using Axios to hit API calls inside that library. we gaveapp-domain
name inpackage.json
andaxios
as dependencies also.import axios from "axios";
Now, If we use this custom library in our
node application
(we are addingapp-domain
in node package.jsondependencies
) we are able to use this Domain class properly and can hit the API's also.But if we use the same thing in our
react (CRA)
application we are getting the below error.After some debugging we found that in the Node application we are getting actual Axios object but during react application we are getting
So Webpack is considering Axios as assets and creates a file for that which we don't need.
Does anyone have any idea how to solve this issue?
Beta Was this translation helpful? Give feedback.
All reactions