Skip to content

Uncaught TypeError is raised for axios.create with axios version 0.22.0 #4153

@ssrikanta

Description

@ssrikanta

Describe the bug

Uncaught TypeError is raised for axios.create with axios version 0.22.0
Issue is observed while merging the defaultConfig, with instanceConfig.
We are setting instanceConfig only

To Reproduce

Exception is raised while creating axios instance with below sample code.

const service  = axios.create({
     baseURL: "host",
     timeout: 3000
})

Expected behavior

Same works with axios version 0.21.4

Environment

  • Axios Version [0.22.0]
  • Browser [Chrome, Edge]
  • Browser Version [Version 94.0.4606.71 (Official Build) (64-bit)]
  • Node.js Version [14.15.1]
  • Additional Library Versions [VueJS 3.2.19, vue-axios 3.3.7]

Additional context/Screenshots

Exception stack trace
axios.js:1308 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys ()
at mergeConfig (axios.js:1308)
at Function.create (axios.js:1712)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions