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

Cannot find "./lib/helpers/buildURL" #107

Open
onlywei opened this issue Feb 24, 2024 · 5 comments
Open

Cannot find "./lib/helpers/buildURL" #107

onlywei opened this issue Feb 24, 2024 · 5 comments

Comments

@onlywei
Copy link

onlywei commented Feb 24, 2024

Versions:

  • axios v1.6.7
  • axios-extensions v3.1.6
  • node v20.11.1
  • npm v10.2.4

Trying to use the cacheAdapterEnhancer fails with the message:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helpers/buildURL' is not defined by "exports" in /Users/wei/axios-test/node_modules/axios/package.json
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/me/axios-test/node_modules/axios-extensions/lib/utils/buildSortedURL.js:10:42)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

To reproduce:

  1. Create a brand new empty folder, cd into it
  2. npm init (with all default settings)
  3. npm i axios axios-extensions
  4. Create an index.mjs file with the following contents:
import { cacheAdapterEnhancer  } from "axios-extensions";

console.log(cacheAdapterEnhancer);
  1. Run node index.mjs
  2. Observe the error.
@onlywei
Copy link
Author

onlywei commented Feb 24, 2024

Tested that the error is not present on axios v0.28.0

@onlywei
Copy link
Author

onlywei commented Feb 24, 2024

I see that this may be fixed with #101

Is v3.1.7 going to be released any time soon?

@onlywei
Copy link
Author

onlywei commented Feb 24, 2024

Wow I just tried npm install [email protected] and it worked.

Something is strange.

This version does not show up on the npmjs page: https://www.npmjs.com/package/axios-extensions

Also simply doing npm install axios-extensions without specifying a version will still result in 3.1.6 being installed.

@kuitos any ideas?

@suhaotian
Copy link

suhaotian commented Mar 8, 2024

@onlywei Do you want give a try of xior, support plugins and easily create your custom plugin, if any questions feel free to ask 😇

@ailishmc
Copy link

Wow I just tried npm install [email protected] and it worked.

Something is strange.

This version does not show up on the npmjs page: https://www.npmjs.com/package/axios-extensions

Also simply doing npm install axios-extensions without specifying a version will still result in 3.1.6 being installed.

@kuitos any ideas?

Thanks so much for flagging this!! Solved my issue

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

3 participants