Open Nefcanto opened 2 months ago
Are you sure that the versions are pinned in both environments?
Bundling is done by rollup and we don't control it.
@wmertens, yes, I'm sure that both use the same NPM packages (versions) for build.
Does rollup also build the source code? Is building and bundling mixed and done in one phase?
Recently we have seen these types of errors:
It comes by itself usually when we start a project, and it goes away, automatically reloading the page.
Since we do not have a dynamic import in the Layout/Component
I guess this might be related to the non-deterministic build.
This is another example of the non-deterministic builds. It's the same app, side by side. Left side you see our development environment. The right side is the same app built and running in the production environment.
These are the differences:
https://github.com/QwikDev/qwik/assets/12782347/14a2bf3a-963c-4cfa-b887-56413424c352
What do you think we should do? We're stuck at delivering sites to our customers. Because what works in the development environment, might or might not work in the prod.
Can you share a minimal reproduction for this? A public URL can be good as well š
@Nefcanto it seems as if you are mixing files from different builds somehow. When you run in dev or preview on your own system does it also fail in this way?
Which component is affected?
Qwik Rollup / Vite plugin
Describe the bug
Very brief. We created a meta-framework on Qwik and Qwik-City. Then we reported https://github.com/QwikDev/qwik/issues/5281. And it did not get solved. We managed to work around it (abandoning some features). Yet now we're stuck again.
This is the problem. We have a
signin
page, and when we click on the button, we get this error:We can't create an MRE. We have tried tens of times with no success. But this time we did something different:
npm run build
andnode server/entry.express.js
in the development environment. The problem is not there.ENV NODE_ENV production
and copy/pasted CI/CD code just after build alongside the original source code into the development container. It did not work as expected. Thenode server/entry.express.js
gave us that error.rm -rf dist && rm -rf server && rm -rf tmp
and rannpm run build
on the same code inside our dev container. It worked.This is an image using the
Beyond Compare
. Left side is the code that does not work. Right side is the same code that works:As you can see, the only difference is the![Screenshot from 2024-05-06 12-53-55](https://github.com/QwikDev/qwik/assets/12782347/90604aec-5db1-49fc-ae00-0f7abe01c096)
dist
andserver
andtmp
directories. And when we usedgrep -rl QuestionParts
this is what we get:As you can see, for the version that does not work, the
QuestionParts
is built into an additional file. But for the version that works it's not built into its own file.Now we use our own dev image for building in our CI/CD pipeline. This means that both are built using the same
NODE_ENV
and using the samenode_modules
. Even you can see that bothnode_modules
directories are symbolic links.I can't find out why it is so. The question is, why do we not get deterministic build outputs for the:
NODE_ENV=production
node_modules
Reproduction
https://github.com/Nefcanto/QwikModuleSpecifier
Steps to reproduce
The reproduction is not simple. Because we have no idea where the problem lies. The specified reproduction is not a real MRE. It's code from our real project. Yet if you would like I can manage to work it out with you and give you a demonstration or send you a film.
System Info
Additional Information
No response