javascript - Uncaught (in promise) TypeError: Object prototype may only be an Object or null: undefined
问题描述
我想将文件上传到实体容器。
我以这段代码为例。 https://github.com/jeff-zucker/solid-file-client/blob/master/docs/node-upload.md
不同之处在于我solid-auth-fetcher
用于授权。代码看起来像这样
const auth = require('solid-auth-cli')
const fc = new SolidFileClient(auth)
await fc.copyFile("file:///home/m0nte-cr1st0/fasf.jpg", "https://dimadmytruk23.inrupt.net/fasf.jpg" )
用户在文件上传时已经登录。
但是,我收到以下错误。
polyfills.js:139 Uncaught (in promise) TypeError: Object prototype may only be an Object or null: undefined
at Function.setPrototypeOf (<anonymous>)
at polyfills.js:139
at patch (polyfills.js:141)
at patch (graceful-fs.js:104)
at Object.<anonymous> (graceful-fs.js:96)
at Object../node_modules/graceful-fs/graceful-fs.js (graceful-fs.js:373)
at __webpack_require__ (bootstrap:789)
at fn (bootstrap:150)
at Object../node_modules/solid-rest/node_modules/fs-extra/lib/fs/index.js (index.js:5)
at __webpack_require__ (bootstrap:789)
at fn (bootstrap:150)
at Object../node_modules/solid-rest/node_modules/fs-extra/lib/index.js (index.js:5)
at __webpack_require__ (bootstrap:789)
at fn (bootstrap:150)
at Object.<anonymous> (file.js:4)
at Object../node_modules/solid-rest/src/file.js (file.js:214)
at __webpack_require__ (bootstrap:789)
at fn (bootstrap:150)
at setRestHandlers (index.js:10)
at Object.fetch (index.js:33)
at SolidFileClient.fetch (SolidApi.js:140)
at SolidFileClient.get (SolidApi.js:155)
at SolidFileClient.copyFile (SolidApi.js:515)
at Transcription.tsx:53
文件在那里。路径是正确的。
解决方案
推荐阅读
- php - 从cron执行的php脚本表现得很奇怪
- datetime - 是否有从不同日期选择一组小时的功能?
- sql - 仅存储 1 个值并删除其余的 bigquery 中相同的重复值
- widget - 如何保持显示最新以监控 tk 小部件的选项值
- youtube-api - 使用 YouTube Data API (v3) 通过 API 密钥更新视频时出现 401 错误
- typescript - TypeORM:SyntaxError:创建迁移时无法在模块外部使用导入语句
- java - 在使用 LinkedBlockingQueue 和 SynchronousQueue 的任务执行器之间进行选择
- python - Tkinter 画布 - 时间和隐藏图像
- python - 如何删除字符串中的所有连续字符并打印剩余的字符串?
- html - 如何修复 HTML 验证错误 - 在 AMP 网站上