question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[merge options] Inconsistent behavior between 0.18.1 and 0.19.0

See original GitHub issue

Describe the bug A clear and concise description of what the bug is. If your problem is not a bug, please file under Support or Usage Question

v0.19.0 changes the source code of merging default options and request options.
But the merging behavior wasn't kept same with v0.18.1.

For example, if default options is:

{
  baseUrl: 'some_url',
  params: {
    foo: 'bar',
  },
}

In v0.18.1, the merged options will contain `params`, but in v0.19.0, the merged options won't contain `params`.

To Reproduce Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question

const instance = axios.create({
  params: {
    foo: 'bar',
  },
});
instance({
  url: 'some_url',
  method: 'get',
});

// in v0.18.1
// GET some_url?foo=bar
// https://codesandbox.io/s/charming-wilson-9wkge

// in v0.19.0
// GET some_url
// https://codesandbox.io/s/nifty-fire-yhhth

Expected behavior A clear and concise description of what you expected to happen.

I think v0.19.0 shouldn't change the merging behavior.

Environment:

  • Axios Version [0.19.0]
  • OS: [OSX 10.14.6]
  • Browser [Chrome]
  • Browser Version [Version 76.0.3809.100 (Official Build) (64-bit)]
  • Additional Library Versions [React 16.9]

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:22
  • Comments:5

github_iconTop GitHub Comments

2reactions
G-Rathcommented, Sep 11, 2019

I’ve just hit this, and found it very surprising. It goes against the use-case of create:

const axios = Axios.create({
  baseURL: url.resolve(process.env.API_URL, '/api'),
  params: { token: process.env.API_TOKEN }
});

While params is less likely to be used compared to say auth or header, at best it’s inconsistent - I’m now scared that any property I provide when calling create will actually be used at all, and so have to spend time figuring out what’ll happen for every property.

0reactions
chinesedfancommented, Jan 10, 2020

So let’s track in #2190. Hope someone can merge and release that soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SciPy 1.6.0 Release Notes — SciPy v1.9.3 Manual
scipy.ndimage.zoom now has a grid_mode option that changes the coordinate of the center of the first pixel along an axis from 0 to...
Read more >
What's new in 1.4.0 (January 22, 2022) - Pandas
These are bug fixes that might have notable behavior changes. Inconsistent date string parsing#. The dayfirst option of to_datetime() isn't strict ...
Read more >
Release history — scikit-learn 0.19.2 documentation
This is documentation for an old release of Scikit-learn (version 0.19). ... and metrics.dcg_score which had been merged into version 0.19.0 by error....
Read more >
Release Notes - Qiskit
Qiskit Metapackage Version qiskit‑terra qiskit‑aer qiskit‑ibmq‑provider Release Date 0.39.4 0.22.3 0.11.2 0.19.2 2022‑12‑08 0.39.3 0.22.3 0.11.1 0.19.2 2022‑11‑25 0.39.2 0.22.2 0.11.1 0.19.2 2022‑11‑03
Read more >
HEPTAPOD_CHANGELOG.md · heptapod-0.30.0rc1 - GitLab
Heptapod 0.19.0 (2021-01-20). Summary of changes since Heptapod 0.18.1. More details are available in the sections below about the release candidates.
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