You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello guys, hope you are well!
First of, thanks for developing this awesome library, much appreciated! ❤️
I'm trying to import useAxiosFetch in my React app as an ES6 module: import { useAxiosFetch } from '@lifeomic/axios-fetch'
Unfortunately, I'm getting the following error:
fromRequireContextWithGlobalFallback.js:21 ReferenceError: exports is not defined
at Module../node_modules/@lifeomic/axios-fetch/src/index.js (index.js:15)
The common use case for us is to use axios-fetch in Node code. I haven't seen that issue before.
I have a feeling you are hitting that because you have some very "pure", ES6 only, code and webpack config. The axios-fetch project doesn't export a ES6 version of the library, so your bundler is not happy to see the commonjs exports reference.
As a hack, could you try adding a "type": "commonjs" entry to the package.json in axios-fetch? Looking at https://webpack.js.org/api/module-methods/ that might help and if it does, then we could add that to the npm module we publish
Hello guys, hope you are well!
First of, thanks for developing this awesome library, much appreciated! ❤️
I'm trying to import
useAxiosFetch
in my React app as an ES6 module:import { useAxiosFetch } from '@lifeomic/axios-fetch'
Unfortunately, I'm getting the following error:
Lines causing error:
Could you please let me know what could be the cause of it?
I'm using v2.0 with Webpack. Let me know if you need me to provide any additional details.
The text was updated successfully, but these errors were encountered: