vue3安装Cookies报错解决方法:

安装Cookies报错解决方法:

npm config delete registry
pnpm install js-cookie
npm config set registry https://registry.npm.taobao.org
pnpm i --save-dev @types/js-cookie

记得导入:

import Cookies from "js-cookie";

然后重启编译器就好了

uni.api.esm.js:898 POST http://127.0.0.1:4000/api/post/add 401 (Unauthorized)(env: Windows,mp,1.06.2412050; lib: 3.8.5) (anonymous) @ uni.api.esm.js:898 invokeApi @ uni.api.esm.js:329 promiseApi @ uni.api.esm.js:787 (anonymous) @ request.js? [sm]:80 request @ request.js? [sm]:79 _postAdd @ post.js? [sm]:14 _callee5$ @ add.js:236 s @ regeneratorRuntime.js?forceSync=true:1 (anonymous) @ regeneratorRuntime.js?forceSync=true:1 (anonymous) @ regeneratorRuntime.js?forceSync=true:1 asyncGeneratorStep @ asyncToGenerator.js?forceSync=true:1 c @ asyncToGenerator.js?forceSync=true:1 (anonymous) @ asyncToGenerator.js?forceSync=true:1 (anonymous) @ asyncToGenerator.js?forceSync=true:1 release @ add.js:252 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 invoke @ vue.runtime.esm.js:5569 invoker @ vue.runtime.esm.js:5581 newTriggerEvent @ uni.mp.esm.js:822 emit2 @ uni.mp.esm.js:119 (anonymous) @ uv-button.js:107 throttle @ throttle.js? [sm]:16 clickHandler @ uv-button.js:106 (anonymous) @ uv-button.js:216 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 invoke @ vue.runtime.esm.js:5569 setTimeout (async) invoker @ vue.runtime.esm.js:5578 index.esm.js:483 需要注册(env: Windows,mp,1.06.2412050; lib: 3.8.5) onError2 @ index.esm.js:483 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 hook.__weh.hook.__weh @ vue.runtime.esm.js:2461 invokeArrayFns @ uni-i18n.es.js:147 callHook @ uni.mp.esm.js:205 errorHandler @ vue.runtime.esm.js:5323 callWithErrorHandling @ vue.runtime.esm.js:1356 handleError @ vue.runtime.esm.js:1396 (anonymous) @ vue.runtime.esm.js:1366 Promise.catch (async) callWithAsyncErrorHandling @ vue.runtime.esm.js:1365 invoke @ vue.runtime.esm.js:5569 invoker @ vue.runtime.esm.js:5581 newTriggerEvent @ uni.mp.esm.js:822 emit2 @ uni.mp.esm.js:119 (anonymous) @ uv-button.js:107 throttle @ throttle.js? [sm]:16 clickHandler @ uv-button.js:106 (anonymous) @ uv-button.js:216 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 invoke @ vue.runtime.esm.js:5569 setTimeout (async) invoker @ vue.runtime.esm.js:5578 index.esm.js:488 TypeError: Cannot use &#39;in&#39; operator to search for &#39;promise&#39; in 需要注册 at index.esm.js:430 at Array.map (<anonymous>) at sendErrorMessages (index.esm.js:429) at onError2 (index.esm.js:485) at callWithErrorHandling (vue.runtime.esm.js:1356) at callWithAsyncErrorHandling (vue.runtime.esm.js:1363) at Array.hook.__weh.hook.__weh (vue.runtime.esm.js:2461) at invokeArrayFns (uni-i18n.es.js:147) at Proxy.callHook (uni.mp.esm.js:205) at errorHandler (vue.runtime.esm.js:5323)(env: Windows,mp,1.06.2412050; lib: 3.8.5) onError2 @ index.esm.js:488 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 hook.__weh.hook.__weh @ vue.runtime.esm.js:2461 invokeArrayFns @ uni-i18n.es.js:147 callHook @ uni.mp.esm.js:205 errorHandler @ vue.runtime.esm.js:5323 callWithErrorHandling @ vue.runtime.esm.js:1356 handleError @ vue.runtime.esm.js:1396 (anonymous) @ vue.runtime.esm.js:1366 Promise.catch (async) callWithAsyncErrorHandling @ vue.runtime.esm.js:1365 invoke @ vue.runtime.esm.js:5569 invoker @ vue.runtime.esm.js:5581 newTriggerEvent @ uni.mp.esm.js:822 emit2 @ uni.mp.esm.js:119 (anonymous) @ uv-button.js:107 throttle @ throttle.js? [sm]:16 clickHandler @ uv-button.js:106 (anonymous) @ uv-button.js:216 callWithErrorHandling @ vue.runtime.esm.js:1356 callWithAsyncErrorHandling @ vue.runtime.esm.js:1363 invoke @ vue.runtime.esm.js:5569 setTimeout (async) invoker @ vue.runtime.esm.js:5578 [worker] reportRealtimeAction:fail not support U @ WAWorker.js:1 invoke @ WAWorker.js:1 invoke @ WAWorker.js:1 G @ WAWorker.js:1 (anonymous) @ WAWorker.js:1 $e @ WAWorker.js:1 Z @ WAWorker.js:1 p @ WAWorker.js:1 (anonymous) @ WAWorker.js:1 (anonymous) @ WAWorker.js:1 setTimeout (async) globalThis.setTimeout @ WAWorker.js:1 Y @ WAWorker.js:1 Re @ WAWorker.js:1 (anonymous) @ WAWorker.js:1 r @ WAWorker.js:1 s @ WAWorker.js:1 callAndRemove @ WAWorker.js:1 invokeCallbackHandler @ WAWorker.js:1 eval @ VM10:1 index.esm.js:483 {data: {…}, header: Proxy, statusCode: 200, cookies: Array(1), accelerateType: "none", …}accelerateType: "none"cookies: ["uuid=s%3A_hsJbey-6kuqFZdixTIZr9KZKOo42zQ1.31m9oR9D…/; Expires=Wed 21 May 2025 02:20:08 GMT; HttpOnly"]data: {code: 400, msg: {…}}errMsg: "request:ok"header: Proxy {X-Powered-By: "Express", appservice-request-id: "4847", Access-Control-Allow-Origin: "*", Content-Type: "application/json; charset=utf-8", Content-Length: "50", …}statusCode: 200__proto__: Object(env: Windows,mp,1.06.2412050; lib: 3.8.5)解决报错
05-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

3446013570@qq.com

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值