-
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
Vite: Build step doesn't work when an export from route file has a server dependency #7931
Comments
The workaround is to move the exported function to a non-route file. IMO, this might be an indicator of poor structure. Because this only happens when route files exports stuff for the purpose of reuse. In other words, the route file might not be the best place for sharing logic. |
Potential duplicate of #7864 |
|
In my case, I have a bunch of barrel exports in my remix codebase and I'm resolving these errors 1 by 1; I've done this v1 to v2+vite migration 4-5 times already for other apps at work and only running into challenges in 1 particular codebase that has lots barrel exports files What are barrel files? |
Duplicate of #7864 |
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
A repo is created to reproduce the issue: alicanerdogan/remix-vite-export-from-route@30d8e71
The changes to the
unstable-vite-express
template is in the following commit: alicanerdogan/remix-vite-export-from-route@30d8e71File: app/lib/service.server.ts
File: app/routes/_index.tsx
Run the following command in the terminal:
Expected Behavior
The assets will be built successfully.
Actual Behavior
The assets are not built.
Here is the error message:
The text was updated successfully, but these errors were encountered: