Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Failed to resolve the module node:* when target ≠ "node"

未關閉
#1,036 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
javascript, node.js
領域
build-system

研究方向

首先使用 Microbundle v0.15.1、非 Node 目標,以及 package.json 中針對 node:fs 和 node:path 的瀏覽器對應來重現問題。將其行為與針對 fs 和 path 的對應進行比較;當帶有 node 前綴的內建模組在瀏覽器相容的建置中無需警告即可解析時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Similar to https://github.com/developit/microbundle/issues/989, but now occurring only when Microbundle's target is not Node.js. I'm compiling a library that runs in both Node.js and a browser, and the library contains dynamic imports for node built-ins like 'fs', executed only in Node.js.

When importing fs I can add the following to my package.json and everything works fine:

"browser": {
  "fs": false,
  "path": false
},

However, using node:fs, the same thing does not work, and warnings appear with:

"browser": {
  "node:fs": false,
  "node:path": false
},
Failed to resolve the module node:fs

Microbundle v0.15.1, Node.js v18.12.1.

主要語言
JavaScript
星號
8.1k
分支
358
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

developit/microbundle 的其他 Issue

查看 developit/microbundle 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。