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
fix(vite): don't generate tasks for remix projects #22551
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 9996b48. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
216ad65
to
04c9195
Compare
Hi @SeanSanker :) Thanks for the contribution! Your solution does work, however, I think it would be better and potentially easier to simply check the |
Hi there, @Coly010! Thank you for your reply! I was going to go down that route, but it seems that in the new Remix Vite setup, they've deprecated the From the new templates here, they don't have the I believe the As a workaround for my other projects at the moment, I've removed the What do you think? |
Yes, reading the documentation more thoroughly this does seem to be the case. In which case the Your solution approach is fine, however, I don't necessarily want us to read every vite config file in the workspace when creating the project graph as this will impact performance. Let me have a think about this and I'll get back to you 🙂 |
That's a very good point!
Sounds good! Let me know if there's anything I can do to help. |
Should it include
|
Found a bug in this logic overall? not really clear if the vite or the remix executor is supposed to run @SeanSanker . But the remix plugin currently has:
And spent a good of bit of time tracing why the tasks were not getting created. had to make an empty |
I (almost) migrated to Vite in @nx/remix . There are just 2 lines of executor's code. However, it is working very well. I am waiting for an info from the dev team regarding 2 options: migrate to 'vite' vs support 'classic' and 'vite' (that's would be harder, obviously) |
I actually just patched this, but doing other bug hunting atm in remix-vite. will post a pnpm patch soon (its a hack). |
Not sure what the executor module does vs plugin as it seems to call a sub process and do things differently. but replacing the command here, then deleting the |
Oh and I also have the PR here as a patch:
|
As mentioned here: #22757 (comment) This PR is focused on preventing Vite from creating erroneous tasks for Remix projects in Nx workspaces that have manually migrated to Vite. We should keep this PR on track. |
Woops, sorry I wasn't aware of that PR 😅 |
07983aa
to
bf9b198
Compare
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> Attempting to use Remix + Vite results in a few errors. I assume this is due to the vite and remix plugins conflicting with each other. One of which being: ``` Failed to process project graph. The "@nx/vite/plugin" plugin threw an error while creating nodes from myremixapp/vite.config.ts: Error: Missing "root" route file in /Users/username/work/remix-demo/app at Object.resolveConfig (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/config.js:154:11) at updateRemixPluginContext (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:367:9) at config (/Users/username/work/remix-demo/node_modules/@remix-run/dev/dist/vite/plugin.js:598:7) ``` ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> It should work just like it currently does for Remix Classic. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> #22035 ## PR Status This is a very early draft. I don't think this is a good approach but it does work for me at the moment. I'm not sure exactly how we can discern a remix project from a vanilla vite project (that you can use standard tooling for) without parsing the `package.json` or `vite.config.ts` and searching for remix-specific content. ## Steps to reproduce my current state Set up a standard @nx/remix project as shown [here](https://nx.dev/recipes/react/remix). Follow the instructions [here](https://remix.run/docs/en/main/future/vite#migrating) from `Migrating` down to but NOT including `Migrating a custom server`. Once I use the modified @nx/vite code provided in this PR, I'm able to run `npx nx dev [app-name]` successfully. ## A Personal Note I'd love to contribute more to nrwl/nx. I'm quite a fan of Nx and use it in a few separate projects. That being said, I don't currently have a comprehensive knowledge of its internals. If anyone wants to give me some guidance (text-based or we can hop on a call), I'd be more than happy to contribute the rest of this myself (and other fixes). --------- Co-authored-by: Colum Ferry <cferry09@gmail.com> (cherry picked from commit 1502433)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Attempting to use Remix + Vite results in a few errors. I assume this is due to the vite and remix plugins conflicting with each other.
One of which being:
Expected Behavior
It should work just like it currently does for Remix Classic.
Related Issue(s)
#22035
PR Status
This is a very early draft. I don't think this is a good approach but it does work for me at the moment. I'm not sure exactly how we can discern a remix project from a vanilla vite project (that you can use standard tooling for) without parsing the
package.json
orvite.config.ts
and searching for remix-specific content.Steps to reproduce my current state
Set up a standard @nx/remix project as shown here.
Follow the instructions here from
Migrating
down to but NOT includingMigrating a custom server
.Once I use the modified @nx/vite code provided in this PR, I'm able to run
npx nx dev [app-name]
successfully.A Personal Note
I'd love to contribute more to nrwl/nx.
I'm quite a fan of Nx and use it in a few separate projects.
That being said, I don't currently have a comprehensive knowledge of its internals.
If anyone wants to give me some guidance (text-based or we can hop on a call), I'd be more than happy to contribute the rest of this myself (and other fixes).