-
Notifications
You must be signed in to change notification settings - Fork 357
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
error: unable to resolve module ~/utils #1610
Comments
What does your file structure look like? where is the utils folder relative to the tsconfig.json? does it for instance work if you change it to this?
and import it as |
The paths entry in my tsconfig.json is configured |
I tried it, but it still doesn't work. |
What does your filestructure look like? Where is the utils folder in relation to your encore app? I tested with the hello world example, updated tsconfig.json as you first did: {
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
/* Basic Options */
"lib": ["ES2022"],
"target": "ES2022",
"module": "ES2022",
"types": ["node"],
"paths": {
"~/*": ["./*"],
"~encore/*": ["./encore.gen/*"]
},
/* Workspace Settings */
"composite": true,
/* Strict Type-Checking Options */
"strict": true,
/* Module Resolution Options */
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"sourceMap": true,
"declaration": true,
/* Advanced Options */
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
} Then I added a folder called I could then import it via I'm not sure if we have fixed anything recently regarding this, or if there is something else that causes the problem here. But maybe you could provide a example app in a git-repo that reproduces the problem. Please also make sure to run the latest version of encore, you can update by running |
Using an drizzle-orm:
This will result in an error :
That's ok :
tsconfig.json :
The text was updated successfully, but these errors were encountered: