-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remix/Vite/EdgeDB: When using edgeql-js with tsx, imported modules are not resolved correctly. #1022
Comments
What does your We have an open issue to rehaul the TS output to take into account all of the new module resolution modes supported by both TypeScript, alternative runtimes (like Deno and Bun), and bundlers, but in the meantime we can figure out what the right incantation for your own particular setup should be. |
Default tsconfig from create-remix@latest: {
"include": [
"**/*.ts",
"**/*.tsx",
"**/.server/**/*.ts",
"**/.server/**/*.tsx",
"**/.client/**/*.ts",
"**/.client/**/*.tsx"
],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@remix-run/node", "vite/client"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
},
// Vite takes care of building everything, not tsc.
"noEmit": true
}
}
|
After moving from yarn to pnpm, this now works with no issues:
pnpm: 9.6.0 |
😅 I still plan on doing a "target" update here to allow building |
Code
Error or desired behavior
"Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/ben/democracy-app/node_modules/edgedb/dist/reflection/index' imported from /home/ben/democracy-app/dbschema/edgeql-js/set.ts
Did you mean to import "edgedb/dist/reflection/index.js"?"
Manually changing all occurrences of
import from "edgedb/dist/reflection/index"
andimport from "edgedb/dist/primitives/buffer"
toimport from "edgedb/dist/reflection/index.js"
andimport from "edgedb/dist/primitives/buffer.js"
fixes the issue.Versions
edgedb-js
version: 1.5.5@edgedb/generate
version: 0.5.3The text was updated successfully, but these errors were encountered: