-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[🐞] Non-deterministic builds #6242
Comments
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? |
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:
non-deterministic-build.mp4What 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? |
Creating an MRE is hard for this. Are there other options for troubleshooting it? |
A weird observation: It seems that route-level event listeners have this problem. For example, the login page has a top-level event listener defined inside the page itself. It does not work. Yet the Add to basket which is inside a component that is imported into the products page works. |
@Nefcanto you have to find out exactly what is going wrong, e.g. it can't find some file. And then you can try to reproduce it in your dev environment and maybe find the issue in qwik or in your deployment system. |
@wmertens, @gioboa, please look at these Dockerfiles. They are both from two different CI/CD pipelines. All the pipelines are the same, except for these Dockerfiles—one works, the other does not.Does not work:
Works:
As you can see, the only difference is that in the first one, we copy/paste the output to a new image. |
Can you see the logs? It must be failing during the copy
Wout.
…On Sat, 13 Jul 2024, 06:54 Saeed Nemati, ***@***.***> wrote:
@wmertens <https://github.com/wmertens>, @gioboa
<https://github.com/gioboa>, please look at these Dockerfiles. They are
both from two different CI/CD pipelines. All the pipelines are the same,
except for these Dockerfiles—one works, the other does not.
Does not work:
FROM holism/site:latest as builder
ENV AUTH_SECRET some_secret
ENV KEYCLOAK_CLIENT_SECRET some_other-secret
ENV KEYCLOAK_ISSUER https://accounts.example.com/realms/Production
ENV NODE_ENV production
COPY . /
RUN chmod 777 --preserve-root /Build \
&& bash /Build
WORKDIR /Holism/SiteQwik
FROM node:lts-bookworm-slim as runner
WORKDIR /Holism/SiteQwik
ENV NODE_ENV production
COPY --from=builder /Holism/SiteQwik/dist ./dist
RUN true
COPY --from=builder /Holism/SiteQwik/server ./server
RUN true
COPY --from=builder /Holism/SiteQwik/node_modules ./node_modules
RUN true
RUN mkdir -p /Temp \
&& chmod -R 777 --preserve-root /Temp
EXPOSE 3000
CMD ["node", "server/entry.express.js"]
------------------------------
Works:
FROM holism/site:latest as builder
ENV AUTH_SECRET some_secret
ENV KEYCLOAK_CLIENT_SECRET some_other-secret
ENV KEYCLOAK_ISSUER https://accounts.example.com/realms/Production
ENV NODE_ENV production
COPY . /
RUN chmod 777 --preserve-root /Build \
&& bash /Build
WORKDIR /Holism/SiteQwik
# FROM node:lts-bookworm-slim as runner
# WORKDIR /Holism/SiteQwik
# ENV NODE_ENV production
# COPY --from=builder /Holism/SiteQwik/dist ./dist
# RUN true
# COPY --from=builder /Holism/SiteQwik/server ./server
# RUN true
# COPY --from=builder /Holism/SiteQwik/node_modules ./node_modules
# RUN true
# RUN mkdir -p /Temp \
# && chmod -R 777 --preserve-root /Temp
EXPOSE 3000
CMD ["node", "server/entry.express.js"]
As you can see, the only difference is that in the first one, we
copy/paste the output to a new image.
Is that not weird?
—
Reply to this email directly, view it on GitHub
<#6242 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANNFQIWQMNWJPKDBUVT23ZMCXHTAVCNFSM6AAAAABHIYZKBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWG43TENJRGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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 #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

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
The text was updated successfully, but these errors were encountered: