Open mguerrero-ias opened 2 months ago
@mguerrero-ias Are you using ESM or CJS? My guess would be it's something with that
@mguerrero-ias Are you using ESM or CJS? My guess would be it's something with that
The project was created with react-scripts, does this give like any indication of that?, otherwise, I guess I don't really know how to check 😝
@mguerrero-ias you could check if your package.json
file contains "type": "module"
?
@mguerrero-ias you could check if your
package.json
file contains"type": "module"
?
It doesn't, but I just found something after looking for some time, it's just more related to React Scripts not supporting CJS. https://github.com/facebook/create-react-app/issues/12700
I guess with this I can mark this bug as not a bug 🤔 . Sorry for wasting your time, I've been looking for info of this issue since the morning.
No worries!
@mguerrero-ias I've recently updated types and publishing for cjs/esm modules. Do you still see the same error on the latest version?
Description
This is a very hard problem to reproduce in a small environment, so I hope this is because I'm doing something wrong and it's immediately obvious from the given configuration.
The App runs, it's just the tests that are failing.
Reproducible example or configuration
We run the old react-script tests like this:
And it gives back this error the moment axios.create is called inside of the Axios Client:
I notice the built file (node_modules/@hey-api/client-axios/dist/node/index.cjs:) includes this:
And I noticed that doing this, fixes it in tests:
I obviously can't leave it like that, so to fix the tests I did this:
OpenAPI specification (optional)
No response
System information (optional)
No response