Preflight checklist
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
Preflight checklist
Ory Network Project
No response
Describe the bug
e.g. the code:
doesn't work, it need to change to
Reproducing the bug
npm run devin 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
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Docker Compose
Additional Context
No response