@ory/elements-react’s ESM build imports an internal file without an extension
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nextjs, react, typescript
- 领域
- build-system, frontend
调研方向
从生成的 dist/client/index.mjs 及其对 session-provider 的导入开始,然后追踪对应的源代码导入,例如 ./frontendClient。在 ESM Next.js 项目中使用 npm run dev 复现;当 @ory/elements-react 能够在没有 ERR_MODULE_NOT_FOUND 的情况下加载时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
## Error Type
Runtime Error
## Error Message
Failed to load external module @ory/elements-react/theme: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/meotimdihia/Sources/myproject/node_modules/@ory/elements-react/dist/client/session-provider' imported from /Users/meotimdihia/Sources/myproject/node_modules/@ory/elements-react/dist/client/index.mjs
at async (.next/server/chunks/ssr/[root-of-the-server]__52545ad9._.js:7:13)
Next.js version: 15.5.4 (Turbopack)
e.g. the code:
import { frontendClient } from "./frontendClient";
doesn't work, it need to change to
import { frontendClient } from "./frontendClient.mjs";
Reproducing the bug
npm run dev in next.js project.
in package.json the project is using ESM "type": "module"
tsconfig.json
{
"compilerOptions": {
"target": "es6",
"lib": ["DOM.Iterable", "ESNext", "DOM", "WebWorker"],
"sourceMap": true,
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": "./",
"paths": {
"@/*": ["./*"]
},
"plugins": [
{
"name": "next"
}
]
},
"include": [
"types.d.ts",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"**/*.d.ts"
],
"exclude": ["node_modules", ".next/types/validator.ts"]
}
Relevant log output
Relevant configuration
Version
"@ory/elements-react": "^1.0.0", "@ory/nextjs": "^1.0.0-rc.0",
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
No response
- 主要语言
- TypeScript
- 星标
- 187
- 派生
- 80
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ory/elements 的其他 Issue
-
Needs Triage
难度 2/5 1-3 小时 新手友好度 70/100
-
Needs Triage
难度 5/5 一周以上 新手友好度 22/100
-
enhancement
难度 3/5 1-2 天 新手友好度 72/100
-
good first issue help wanted upstream
难度 2/5 1-3 小时 新手友好度 45/100
-
good first issue help wanted upstream
难度 3/5 1-2 天 新手友好度 25/100
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 90/100
lingdojo/kana-dojo#32663 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
Admin: Title Separator field can't be cleared (input falls back to "|")可能已有人在做 @emdashbot 今天认领。 未关闭bot:bug bot:in-review
难度 2/5 1-3 小时 新手友好度 80/100
emdash-cms/emdash#4236 · 3 条评论 ·
维护者通常 1 天内回复
-
PHP workflow streaming requests buffer the full SSE response可能已有人在做 @Winoren 今天认领。 未关闭review: medium
难度 2/5 1-3 小时 新手友好度 84/100
langgenius/dify#44270 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
area:holodeck review-finding
难度 2/5 1-3 小时 新手友好度 62/100
hyperdrive-technology/holodeck#142 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
code-yeongyu/senpi#3573 ·
维护者通常 1 天内回复