-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
In Vite Dev Mode, module aliases do not work #8751
Comments
If the underlying root cause is with Context: |
I have tried using that by modifying the |
I think this is a same issue as this upstream issue: When you have genuine This behavior is probably a bug on Vite, but their general recommendation is to use package manager based alias such as I tried this approach here, but it looks like there's a hydration error, so it might take some more effort to actually integrate |
Reproduction
To setup:
yarn install
To see the error:
yarn run dev
To understand it's not aliasing:
react-native
withreact-native-web
yarn run dev
To see that aliasing works in build mode (not development):
react-native
instead ofreact-native-web
yarn run build
yarn run start
System Info
Stackblitz:
My machine:
Used Package Manager
yarn
Expected Behavior
In Vite Dev Mode, modules should be aliased when defined in
resolve.alias
invite.config.ts
.Actual Behavior
Modules are not aliased when running
dev
. They are instead properly aliased when runningbuild
.I have discovered after some investigation that the errors happens in the vite plugin, precisely when running
await viteDevServer.ssrLoadModule(serverBuildId);
.The text was updated successfully, but these errors were encountered: