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.

Vue.http undefined in v1.3.1

See original GitHub issue
let vueResource = require('vue-resource');
Vue.use(vueResource);
Vue.http.options.emulateJSON = true;

got an error in v1.3.1. Uncaught TypeError: Cannot read property 'options' of undefined it’s obvious that Vue.http is undefined.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
frontsomnicommented, Jan 5, 2018

version 1.3.5

/** require ** /

let vueResource = require('vue-resource');
Vue.use(vueResource.default);

/** ES6 import **/

import VueResource from 'vue-resource'
Vue.use(vueResource);
4reactions
kymtwyfcommented, Aug 28, 2017

@yernsun No idea about why, but using import like below works for me

import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.http.options.emulateJSON = true;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to use $http or Vue.http - Stack Overflow
You need to check for this.$http from within a Vue instance method: import Vue from 'vue'; Vue.use(require('vue-resource')); new Vue({ el: ...
Read more >
Vue.http is undefined - Laracasts
I get Vue.http is undefined in the console log. However, it works fine when I use the same method in a component. What...
Read more >
cannot read properties of undefined (reading 'call') vue
The error message suggests you are trying to read something from an array at a specific index that is undefined. The only occurrence...
Read more >
Node.js v19.3.0 Documentation
Now, open any preferred web browser and visit http://127.0.0.1:3000 . If the browser displays the string Hello, World! , that indicates the server...
Read more >
Resolved:Failed to load API definition (undefined /swagger/v1 ...
Fetch error undefined /swagger/v1/swagger.json” ... ASP.NET Core 3.1 or 5.0 – Add Swagger OpenAPI V3.0 specification documentation.
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