-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Vite: custom tsconfig paths are not respected when I pass getLoadContext to the Cloudflare Proxy plugin #9171
Comments
It would be useful to see your full tsconfig.json and package.json. |
I faced the same problem. I think this is due to the fact that vite does not allow the use of tsconfig paths in vite.config.ts |
@jebenois tsconfig.json:
package.json
|
any update on this? I can't use paths. |
Here are a couple workarounds for this.
// package.json
"build": "remix vite:build",
"start": "wrangler pages dev ./build/client",
"preview": "npm run build && npm run start",
"dev": "nodemon --watch ./app/** --watch ./load-context.ts --ext js,json,ts,tsx --exec \"npm run preview\"",
|
I'm having the same issue here. I need to use vite. NOT wrangler, as wrangler cpu profling and debugging is currently broken. |
Vite currently has issues importing TS files with path aliases from the
|
Tried out the To help fixing the root cause here are some details, I came across the same issue while trying out the remix + cloudflare workers example and passing I am not sure if this issue is related to Vite or Vite importing with
So it looks like as soon as we pass |
Reproduction
According to the docs i have to pass getLoadContext to remix
I have a path setting in the tsconfig.json
This is my vite.config.ts:
System Info
Used Package Manager
pnpm
Expected Behavior
custom paths must be respected when I pass getLoadContext to the Cloudflare Proxy plugin
Actual Behavior
i got error:
"Error [ERR_MODULE_NOT_FOUND]: Cannot find package '~' imported from ..."
The text was updated successfully, but these errors were encountered: