v0.27.0 Uncaught (in promise) TypeError: url.parse is not a function

See original GitHub issue

Describe the bug

All axios based requests crashed in v0.27.0, but it’s ok if downgrade to v0.26.1

To Reproduce

npm i axios@0.27.0
axios.post('http://localhost:3000/api', {})

Expected behavior

No exceptions.

Environment

  • Axios Version [0.27.0]
  • Adapter [e.g. XHR/HTTP]
  • Browser [e.g. Chrome, Safari]
  • Browser Version [e.g. 22]
  • Node.js Version [e.g. 13.0.1]
  • OS: [e.g. iOS 12.1.0, OSX 10.13.4]
  • Vue [3.2.25]
  • Vite [2.9.5]
  • Additional Library Versions [e.g. React 16.7, React Native 0.58.0]

Additional context/Screenshots

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jasonsaaymancommented, Apr 26, 2022

This was a fault with the release, please try 0.27.1 this should fix these errors, if not please mention me again in a comment here.

2reactions
ddolcimascolocommented, Apr 26, 2022

Guys,

Our CRA app does not build with v0.27.0 with the following error message, I’m suspecting it’s the same issue…

> craco build
Creating an optimized production build...
Failed to compile.
Module not found: Error: Can't resolve 'url' in '/builds/stordata/cmdb/frontend/node_modules/axios/lib/adapters'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
	- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "url": false }

This is a frontend app, so no url module to depend on 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: url.parse is not a function · Issue #2751 - GitHub
But I am getting an error called TypeError: url.parse is not a function while trying to fetch from my dataset. Using: Vue 3.2.9;...
Read more >
TypeError: url.parse is not a function (fetching data from sanity ...
But I am getting an error called TypeError: url.parse is not a function while trying to fetch from my dataset.
Read more >
URL | Node.js v19.3.0 Documentation
The node:url module provides utilities for URL resolution and parsing. ... A TypeError will be thrown if the input or base are not...
Read more >
url-parse - npm
Small footprint URL parser that works seamlessly across Node.js and browser environments. Latest version: 1.5.10, last published: 10 months ...
Read more >
Axios - Best of JS
Promise based HTTP client for the browser and node.js ... to parse the response string as JSON even if `responseType` is not 'json'...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found