微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 tossr 路由 SSR 问题: throw new ERR_INVALID_ARG_TYPE('target', ['Buffer', 'Uint8Array'], target);

如何解决使用 tossr 路由 SSR 问题: throw new ERR_INVALID_ARG_TYPE('target', ['Buffer', 'Uint8Array'], target);

我正在使用 Routify 框架构建一个网站。 在 yarn run serve 时,在 yarn run build 之后,我收到错误消息。

node:buffer:202
    throw new ERR_INVALID_ARG_TYPE('target',['Buffer','Uint8Array'],target);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "target" argument must be an instance of Buffer or Uint8Array. Received null
    at new NodeError (node:internal/errors:329:5)
    at _copy (node:buffer:202:11)
    at Buffer.copy (node:buffer:776:12)
    at Request.<anonymous> (/Users/SEOngto/devs/front-end/f14-allius-public-routify/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:864:11)
    at Request.emit (node:events:378:20)
    at Gunzip.<anonymous> (/Users/SEOngto/devs/front-end/f14-allius-public-routify/node_modules/request/request.js:1073:12)
    at Gunzip.emit (node:events:378:20)
    at addChunk (node:internal/streams/readable:313:12)
    at readableAddChunk (node:internal/streams/readable:288:9)
    at Gunzip.Readable.push (node:internal/streams/readable:227:10) {
  code: 'ERR_INVALID_ARG_TYPE'
}

那是什么?有什么解决办法吗?

运行yarn run dev时不会出现问题

以下是我的 package.json 脚本。

"scripts": {
    "dev": "run-p routify nollup","dev:ssr": "run-p routify rollup","build": "run-s build:*","build:app": "routify -b && rollup -c","build:static": "spank","serve": "spassr --ssr","rollup": "rollup -cw","nollup": "nollup -c","routify": "routify"

附言我想做的是SSR。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。