开发者社区 > 云存储 > 对象存储OSS > 正文

Nuxt3 在yarn build 时 遇到错误

rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/setSTSToken.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/client/getReqUrl.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/createRequest.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/encoder.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/getStandardRegion.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/retry.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/isFunction.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/checkBucketName.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/isBuffer.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/obj2xml.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/encodeString.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/omit.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/deepCopy.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/setRegion.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/utils/checkConfigValid.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/object/getAsyncFetch.ts. Consider restricting the plugin to particular files via options.include
rollup-plugin-inject: failed to parse E:/xxx/node_modules/ali-oss/lib/common/object/postAsyncFetch.ts. Consider restricting the plugin to particular files via options.include

1: import { formatObjKey } from './formatObjKey';
2:
3: export async function setSTSToken(this: any) {
                                     ^
4:   if (!this.options) this.options = {};

Unexpected keyword 'this' (Note that you need plugins to import files that are not JavaScript)                                                                                                                                                                                                        19:22:06  

  at error (/E:/xxx/node_modules/rollup/dist/es/shared/node-entry.js:2125:30)
  at Module.error (/E:/xxx/node_modules/rollup/dist/es/shared/node-entry.js:13452:16)
  at Module.tryParse (/E:/xxx/node_modules/rollup/dist/es/shared/node-entry.js:14163:25)
  at Module.setSource (/E:/xxx/node_modules/rollup/dist/es/shared/node-entry.js:13765:39)
  at ModuleLoader.addModuleSource (/E:/xxx/node_modules/rollup/dist/es/shared/node-entry.js:23730:20)

当前用的nodejs版本 v18.20.2
npm版本 10.8.0
yarn 版本# 1.22.22
系统win11
目前是不知道是oss这边的问题还是nuxt配置的问题,有清楚的大佬帮忙看下吗?

展开
收起
游客63tiznjtafzog 2024-05-21 19:52:26 156 0
1 条回答
写回答
取消 提交回答
  • 遇到了同样的问题,请问你的问题解决了吗,
    node版本 v18.16.0
    nuxt版本 v3.13.2
    ali-oss版本 v6.21.0
    vite版本 5.4.9

    image.png

    2024-10-17 14:20:56
    赞同 展开评论 打赏

对象存储 OSS 是一款安全、稳定、高性价比、高性能的云存储服务,可以帮助各行业的客户在互联网应用、大数据分析、机器学习、数据归档等各种使用场景存储任意数量的数据,以及进行任意位置的访问,同时通过丰富的数据处理能力更便捷地使用数据。

热门讨论

热门文章

相关电子书

更多
深度学习+大数据 TensorFlow on Yarn 立即下载
Docker on Yarn 微服务实践 立即下载
深度学习+大数据-TensorFlow on Yarn 立即下载