Open lmq352489099 opened 1 year ago
我也遇到了这个问题,怎么解决?
`ℹ ✓ 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那边配置的问题
阿里云sdk的问题
我也遇到了这个问题,怎么解决?
在我的PR未合并发版之前,临时解决办法:node_modules/ali-oss/lib 下面的ts文件全部删除,重新打包应该就可以了 window 环境执行以下命令
find ./lib -name "*.ts" -type f -delete
`ℹ ✓ 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那边配置的问题