Bindings to React modules are incompatible with node ESM
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, node.js, react
- 領域
- frontend
研究方向
使用報告中連結的 ReScript Pages 升級重現該失敗,並檢查 src/PagesServer.mjs 中產生的 react/jsx-runtime import。追蹤 React 模組宣告的產生位置,並在 Node ESM 下驗證產生的 imports。產生的 bindings 能在執行階段解析且不會出現 ERR_MODULE_NOT_FOUND,即表示完成。
由索引模型根據 Issue 內容生成。
描述
hello 👋
great work on the release!
I just found out that the new bindings, omitting the .js extension break when using node in ESM mode, as it tries to resolve to .mjs when unspecified. It currently breaks ReScript Pages (https://github.com/bloodyowl/rescript-pages/tree/upgrade-rescript-react) at runtime with the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Volumes/Dev/bloodyowl/rescript-pages/node_modules/react/jsx-runtime' imported from /Volumes/Dev/bloodyowl/rescript-pages/src/PagesServer.mjs
Did you mean to import react/jsx-runtime.js?
at new NodeError (node:internal/errors:393:5)
at finalizeResolution (node:internal/modules/esm/resolve:305:11)
at moduleResolve (node:internal/modules/esm/resolve:866:10)
at defaultResolve (node:internal/modules/esm/resolve:1074:11)
at nextResolve (node:internal/modules/esm/loader:164:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:839:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:426:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
and will most likely break any project in this configuration.
would you consider a PR adding the extensions back into the declarations?
- 主要語言
- ReScript
- 星號
- 517
- 分支
- 45
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rescript-lang/rescript-react 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
rescript-lang/rescript-react#145 ·
-
難度 3/5 1-2 天 新手友好度 48/100
rescript-lang/rescript-react#152 · 3 個 reaction ·
-
難度 5/5 一週以上 新手友好度 45/100
rescript-lang/rescript-react#147 · 2 則留言 ·
-
難度 5/5 一週以上 新手友好度 25/100
rescript-lang/rescript-react#111 · 3 則留言 ·
-
難度 4/5 3-5 天 新手友好度 25/100
rescript-lang/rescript-react#105 ·
查看 rescript-lang/rescript-react 的全部 Issue
相似的 Issue
-
good first issue
難度 1/5 1 小時以內 新手友好度 95/100
AOSSIE-Org/DebateAI#582 · 2 則留言 ·
-
📕documentation
難度 2/5 1-3 小時 新手友好度 75/100
db-ux-design-system/core-web#8239 ·
-
Area/AI Type/Improvement
難度 1/5 1 小時以內 新手友好度 95/100
wso2/product-integrator#2567 ·
-
難度 1/5 1 小時以內 新手友好度 80/100
learningequality/kolibri#15351 · 2 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 75/100