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.

Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined

See original GitHub issue

Hi!

I’m trying to use your library but I get an error:

Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined

I was using your example

axios.get('https://api.github.com/users/benjamingeorge')
  .then(function (res) {
    console.log(res.data);
  })
  .catch(function(res) {
    if(res instanceof Error) {
      console.log(res.message);
    } else {
      console.log(res.data);
    }
  });

The error happens here. I’m using browserify and chrome 45.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:15
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

65reactions
ivitivancommented, Oct 1, 2015

Actually, I can not even reproduce the error now.

44reactions
EmadAdlycommented, Jul 7, 2017

If you use vue or another just

import axios from 'axios'

And use Axios normally without using Vue.use(axios)

Everything works fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'protocol' of undefined - Stack Overflow
This error occurs when something goes wrong in request, for ex. if you set url as undefined, invalid method, or invalid content type, ......
Read more >
TypeError: Cannot read property 'protocol' of undefined #632
i've an error, and i can't solved it alone :) my error message is : TypeError: Cannot read property 'protocol' of undefined at...
Read more >
Cannot read property 'protocol' of undefined - Get Help
I have an error trying to move the request URL into a separate file called service.js If i make the request directly in...
Read more >
Cannot read property 'protocol' of undefined using axios with ...
Coding example for the question Why do I have TypeError: Cannot read property 'protocol' of undefined using axios with vue?-Vue.js.
Read more >
React Js: Unhandled Rejection (Typeerror) - ADocLib
I'm trying to use your library but I get an error: Uncaught in promise TypeError: Cannot read property 'protocol' of undefined. I was...
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