Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookies helper issue with Vue.js Async Components #1105

Closed
rbown opened this issue Sep 26, 2017 · 1 comment
Closed

Cookies helper issue with Vue.js Async Components #1105

rbown opened this issue Sep 26, 2017 · 1 comment

Comments

@rbown
Copy link
Contributor

rbown commented Sep 26, 2017

Summary

When using Vue.js Async Components (https://vuejs.org/v2/guide/components.html#Async-Components) that use an Axios GET request it returns an Error "TypeError: cookies.read is not a function".

It appears the cookies helper is not loaded correctly.

Possible Solution

Moving line 106;

var cookies = require('./../helpers/cookies');

Outside of the xhrAdapter function resolves the problem.

var utils = require('./../utils');
var settle = require('./../core/settle');
var cookies = require('./../helpers/cookies');
var buildURL = require('./../helpers/buildURL');
var parseHeaders = require('./../helpers/parseHeaders');
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
var createError = require('../core/createError');
var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || require('./../helpers/btoa');

Context

  • axios version: v0.16.2
  • Environment: node v6.10.1, Vue.js 2.4.4, chrome 60, OSX 10.12.6
@robaxelsen
Copy link
Contributor

Hi @rbown, thanks for reporting this issue. Instead of linking to change in your own fork, could you please submit this as a PR to this repo?

@axios axios locked and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants