-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
RR Vite plugin build
command lifecycle differs from the dev
one
#13078
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
Comments
I just tried replicating this issue using rollup-plugin-dedent, which I published yesterday. I'm using the plugin in Vite, and it also uses |
ok, then maybe it's a strange interaction with the pnpm monorepo setup we are using. I cleaned up some things so, in this branch: https://github.com/plone/volto/tree/7 It's using RR 7.1.5, the command This branch: is created from the previous but using RR 7.2.0 and it's failing (see CI red actions): https://github.com/plone/volto/actions/runs/13461807540/job/37618720542?pr=6774 for the same command. As said, I tried to debug it, and the code does not reach the plugin in build mode whereas in dev it does. |
@sneridagh Are you able to create a minimal repro? Looking at your CI output and reproducing locally, it looks like your |
@markdalgleish hey, thanks for taking a look. I can put together an even minimum version, in a separated repo, but the error given will be the same, since the file that is expected to be generated, it won't be generated. Then RR7 will complain about the |
Edited, see now: #13078 (comment)
|
Ok, I think I've pinpointed the problem. It seems that it's a timing problem, in 7.1.5 my plugin finalized the creation of the file before the @markdalgleish Did you change how the processes that take place in the RR7 plugin so they can take precedence before our plugin? If it's not this, I don't know what could cause the timing issue... a reminder that in dev, it also works well in 7.2.0, the timing issue is only present on build. |
Update: I wasn't trying to load the file in my minimal reproduction, so it passed (obviously), sorry for the noise. Now it breaks like in my update to 7.2.0 branch. Please check it now: https://github.com/sneridagh/my-react-router-app in dev works, in build mode it does not. |
build
command lifecycle differs from the dev
one
I've digged in the code, specially your last PR introducing the support for the Vite 6 environments API. I think that after that, the I understand that it might not be an issue for you, and you really want that this has to be the behavior of the However, in other scenarios could be that this is still relevant for other people, that want to have some pre-processing before Thanks for the attention and support, and keep up the good work! |
@sneridagh You said the build in your repro isn't working, but seems to work for me. Here's the full set of commands I'm running: git clone [email protected]:sneridagh/my-react-router-app.git
cd my-react-router-app
pnpm install
pnpm build Here's the output I'm seeing:
Is there something else I'm meant to be looking for? |
@markdalgleish sorry, my bad, I thought I pushed the changes :( I'm really sorry for this. Now I've pushed the changes, where you could see that the required file is being generated by the dev script, while the build script it does not, thus the |
Thanks for updating the repro. I've just merged a PR that fixes the build step for the repro you provided, it'll be out in the next release: #13513 As the PR describes, we now avoid evaluating I tested it using this experimental release if you want to try it out in the meantime: |
@markdalgleish I tested it, and it does work like a charm. Thanks a lot!!! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
I'm using React Router as a...
framework
Reproduction
I have a custom Vite Plugin that generates a file with additional routes for my RR7 app. For more information, this Vite plugin is a
pre
plugin.It worked well until we updated to 7.2.0 where it broke when building. In dev it works well. In order to prove that the plugin is just ignored I even broke the Vite plugin code, and it did not errored (while in dev did).
I'm sorry right now I can't post a reproduction repo, also it would be hard to explain in detail what the Vite plugin does and how to test that it does not work. If really needed I can try, but I'm hoping that this rings some bells.
When 7.1.5 is used, it works perfectly, as it used to.
System Info
Used Package Manager
pnpm
Expected Behavior
My custom Vite plugin is executed in build mode. In 7.1.5 is used, it works perfectly, as it used to.
Actual Behavior
My custom Vite plugin seems that does not run in build mode, but it does in dev mode.
The text was updated successfully, but these errors were encountered: