Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

RollupError in Nuxt 4 module.

未关闭
#665 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
node.js, rollup, typescript
领域
build-system

调研方向

首先在链接的 nuxt-openAPI-wrapper playground 中复现 Nuxt 4 构建,并检查生成的 .nuxt/openapi-wrapper/index.ts 入口点。阅读 rollup-plugin-inject 失败信息,并比较 Nuxt 3 和 Nuxt 4 的构建路径。完成的标准是 playground 构建能够在没有报告的 RollupError 的情况下完成。

由索引模型根据 Issue 内容生成。

描述

needs reproduction
Environment

  • Operating System: Windows_NT
  • Node Version: v24.7.0
  • Nuxt Version: 4.1.1
  • CLI Version: 3.28.0
  • Nitro Version: 2.12.5
  • Package Manager: [email protected]
  • Builder: -
  • User Config: modules, build
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Im trying to update my module (https://github.com/Pentadome/nuxt-openAPI-wrapper/tree/nuxt-4) to Nuxt 4. but after updating, whenever i build the playground, i get this rollup error:

(node:456) [DEP0155] DeprecationWarning: Use of deprecated trailing slash pattern mapping "./" in the "exports" field module resolution of the package at C:\Users\user\repos\nuxt-open-api\nuxt-openapi-wrapper\playground\node_modules\@vue\shared\package.json imported from C:\Users\user\repos\nuxt-open-api\nuxt-openapi-wrapper\playground\node_modules\nuxt\dist\core\runtime\nitro\templates\error-dev.js. Mapping specifiers ending in "/" is no longer supported.
(Use `node --trace-deprecation ...` to show where the warning was created)
[plugin inject] playground/node_modules/.cache/nuxt/.nuxt/openapi-wrapper/index.ts: rollup-plugin-inject: failed to parse C:/Users/user/repos/nuxt-open-api/nuxt-openapi-wrapper/playground/node_modules/.cache/nuxt/.nuxt/openapi-wrapper/index.ts. Consider restricting the plugin to particular files via options.include

 ERROR  RollupError: playground/node_modules/.cache/nuxt/.nuxt/openapi-wrapper/index.ts (1:7): Expected '{', got 'type' (Note that you need plugins to import files that are not JavaScript)                                             nitro 15:44:33  


1: export type * from "C:/Users/user/repos/nuxt-open-api/nuxt-openapi-wrapper/dist/runtime/fetchTypes";
Describe the bug

I did not get this error when building for Nuxt 3.

Additional context

No response

Logs

主要语言
TypeScript
星标
277
派生
36
平均合并
2 小时 46 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nuxt/module-builder 的其他 Issue

查看 nuxt/module-builder 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。