Comments (3)
提供一个最小复现的仓库
from ali-oss.
错误 RollupError:意外的关键字“this”(请注意,您需要插件来导入非 JavaScript 的文件) 硝基 20:07:05
7:从'../utils/checkConfigValid'导入{checkConfigValid}; 8: 9: 导出函数 getReqUrl(this: any, params) { ^ 10: const ep: any = {}; 11: const isCname = this.options.cname;
错误意外的关键字“this”(请注意,您需要插件来导入非 JavaScript 的文件)20:07:05
出错时(/D:/Works/yefang/fs-nuxt-taozi-h5/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:2124:30) 在Module.error(/D:/Works/yefang/fs-nuxt-taozi-h5/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:13463: 16) 在Module.tryParse(/D:/Works/yefang/fs-nuxt-taozi-h5/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js: 14184:25) 在 Module.setSource (/D:/Works/yexiang/fs-nuxt-taozi-h5/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry。 js:13786:39) 在 ModuleLoader.addModuleSource (/D:/Works/yexiang/fs-nuxt-taozi-h5/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-条目.js:23782:20)
nuxt3项目构建不过。降级5.3.2
是nuxt3降级还是alioss降级
from ali-oss.
`ℹ ✓ built in 13.04s 17:34:27
✔ Server built in 13060ms 17:34:27
✔ Generated public .output/public nitro 17:34:27
ℹ Building Nitro Server (preset: node-server) nitro 17:34:27
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/client/getReqUrl.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/createRequest.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/encoder.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/setSTSToken.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/isFunction.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/retry.ts. Consider restricting the plugin to particular files via options.include
(esbuild plugin) [esbuild] (.nuxt/dist/server/_nuxt/writer-5235dab7.js:1563:10) This assignment will throw because "cur_notebook" is
a constant
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/isBuffer.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/obj2xml.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/checkBucketName.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/deepCopy.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/setRegion.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/checkConfigValid.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/getBucketInventory.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/completeBucketWorm.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/deleteBucketInventory.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/putBucketInventory.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/abortBucketWorm.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/initiateBucketWorm.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/extendBucketWorm.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/listBucketInventory.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/bucket/getBucketWorm.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/object/postAsyncFetch.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/object/getAsyncFetch.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/checkBucketTag.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/formatObjKey.ts. Consider restricting the plugin to particular files via options.include
(inject plugin) rollup-plugin-inject: failed to parse F:/project-lmq/learn-self-study/bingo-book/j2-book/node_modules/ali-oss/lib/common/utils/policy2Str.ts. Consider restricting the plugin to particular files via options.include
ERROR RollupError: Unexpected keyword 'this' (Note that you need plugins to import files that are not JavaScript) nitro 17:35:31
7: import { checkConfigValid } from '../utils/checkConfigValid';
8:
9: export function getReqUrl(this: any, params) {
^
10: const ep: any = {};
11: const isCname = this.options.cname;
ERROR Unexpected keyword 'this' (Note that you need plugins to import files that are not JavaScript)`
这个是ali-oss的问题 还是nuxt3那边配置的问题
from ali-oss.
Related Issues (20)
- 当我使用nuxt3 来使用ali-oss 的上传功能,在build的时候发生这个问题 HOT 1
- cancel如何暂停某个文件的上传 HOT 1
- Node 最新版本 enableProxy 导致找不到 x-oss-request-id HOT 3
- 6.18.0 更新日志在哪里?是 npm 账号被盗用了么? HOT 3
- window is not defined in webworker HOT 2
- Is there a way to multipart upload with signedUrl?
- Object.put 指定 file 为路径时响应没有 url 吗
- Bug: Nuxt3+ts项目 打包报错 HOT 8
- 上传失败错误-1 HOT 2
- 在vite中使用出现开发环境与生产环境表现不一致的问题 HOT 1
- VUE3+VITE 使用oss打包时报错 HOT 1
- ali-oss 不支持在 cloudflare workers 中使用 HOT 2
- 使用 6.18.1 版本在 next.js 框架下以及 nodejs v18.14.2 环境中提示依赖 proxy-agent implementation 找不到 HOT 1
- 如何实现大文件断点续传下载 HOT 1
- vite使用ali-oss时打包出错
- 能否支持CLI, 命令行调用?
- 多个文件上传,如何更新进度条
- https://registry.npm.taobao.org/ali-oss: certificate has expired HOT 1
- Nextjs Critical dependency: the request of a dependency is an expression HOT 3
- 浏览器里下载较大的文件后,无法解析,报错 RangeError: Invalid array length
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ali-oss.