发布于 

错误合集

1.Uncaught SyntaxError: Unexpected token ‘{’

我在引入css文件代码的时候,没注意把js引入当css引入来写了导致报错

2.Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR

请求协议问题需将https换成http【注:插件】

3.Uncaught TypeError: Cannot read property ‘imports’ of undefined

date写成data dateFormat写成dataFormat 粗心导致

4.TypeError: Cannot read property ‘data’ of undefined

stack: “TypeError: Cannot read property ‘cancelToken’ of undefined↵ at throwIfCancellationRequested (webpack-internal:///./node_modules/axios/lib/core/dispatchRequest.js:12:14)↵ at dispatchRequest (webpack-internal:///./node_modules/axios/lib/core/dispatchRequest.js:24:3)”

message: “Cannot read property ‘cancelToken’ of undefined”

解决:判断如果当前有token就带token,如果没有反之

我判断了但是还是报错,发现在axios拦截器并没有加返回值也就是return config

5.清理npm缓存

npm cache clean -f


本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。