R
Railway4mo ago
Boxer

React vinxi app failing build

Hi there, for some reason my build is failing for my vinxi app here are the build logs:
#9 DONE 0.0s



#10 [stage-0 6/10] RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile



#10 0.876  WARN  Ignoring not compatible lockfile at /app/pnpm-lock.yaml



#10 0.879  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent

#10 0.879

#10 0.879 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

#10 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1

-----

> [stage-0 6/10] RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile:

0.876  WARN  Ignoring not compatible lockfile at /app/pnpm-lock.yaml

0.879  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent

0.879

0.879 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

-----





2 warnings found (use --debug to expand):

- UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 18)



Dockerfile:20

-------------------

18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH

19 | COPY . /app/.

20 | >>> RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile

21 |

22 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
#9 DONE 0.0s



#10 [stage-0 6/10] RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile



#10 0.876  WARN  Ignoring not compatible lockfile at /app/pnpm-lock.yaml



#10 0.879  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent

#10 0.879

#10 0.879 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

#10 ERROR: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1

-----

> [stage-0 6/10] RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile:

0.876  WARN  Ignoring not compatible lockfile at /app/pnpm-lock.yaml

0.879  ERR_PNPM_NO_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent

0.879

0.879 Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

-----





2 warnings found (use --debug to expand):

- UndefinedVar: Usage of undefined variable '$NIXPACKS_PATH' (line 18)

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 18)



Dockerfile:20

-------------------

18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH

19 | COPY . /app/.

20 | >>> RUN --mount=type=cache,id=s/047d91cb-fd36-4784-9efc-af0c5dbe5158-/root/local/share/pnpm/store/v3,target=/root/.local/share/pnpm/store/v3 pnpm i --frozen-lockfile

21 |

22 | # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c pnpm i --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed
90 Replies
Percy
Percy4mo ago
Project ID: 047d91cb-fd36-4784-9efc-af0c5dbe5158,047d91cb-fd36-4784-9efc-af0c5dbe5158,047d91cb-fd36-4784-9efc-af0c5dbe5158
Boxer
BoxerOP4mo ago
Project ID: f78d75b5-8972-4d61-8517-22bbccefb41e
Brody
Brody4mo ago
so what is vinxi?
Boxer
BoxerOP4mo ago
it's a js builder https://vinxi.vercel.app/
Vinxi
Vinxi Documentation
Boxer
BoxerOP4mo ago
so it's used by tanstack
Brody
Brody4mo ago
interesting haven't seen anyone ask for help to deploy it
Boxer
BoxerOP4mo ago
yeah is that the problem?
Brody
Brody4mo ago
but I see two issues, you aren't specifying the correct pnpm version, and you are attempting to run a development server after committing on that other thread I'd thought you'd be a little more conscious on running things that use a lot of unnecessary memory 😆
Boxer
BoxerOP4mo ago
🤣 I didn't want to write a backend server for my react app so was trying this app with server functions
Brody
Brody4mo ago
SSR?
Boxer
BoxerOP4mo ago
Server Functions | TanStack Router React Docs
As TanStack Start is a full-stack framework, we need a way to call a function on the client which then executes some code on the server. This is where Server Functions come in.
Brody
Brody4mo ago
can you link to an example project that's most like what your own project is?
Boxer
BoxerOP4mo ago
StackBlitz
Router Start Basic Counter Example - StackBlitz
Run official live example code for Router Start Basic Counter, created by Tanstack on StackBlitz
Brody
Brody4mo ago
thanks, I'll see about getting that properly deployed on railway
Boxer
BoxerOP4mo ago
Cool thanks, if it's too much dw about it i can always work on the traditional react way
Brody
Brody4mo ago
I'm sure it won't be too much
Brody
Brody4mo ago
it doesnt even build lol
No description
Boxer
BoxerOP4mo ago
Oh wtf Ah you need to install @vitejs/plugin-react And dev should run after I just cloned it to my local
Brody
Brody4mo ago
can you build it?
Boxer
BoxerOP4mo ago
Yeah it builds. Let me make my repo available if that helps
Brody
Brody4mo ago
what version of node
Boxer
BoxerOP4mo ago
22.1
Boxer
BoxerOP4mo ago
No description
Brody
Brody4mo ago
ill try
Boxer
BoxerOP4mo ago
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build --preset node-server",
"start": "vinxi start",
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build --preset node-server",
"start": "vinxi start",
Brody
Brody4mo ago
noted
Boxer
BoxerOP4mo ago
the reason i was using dev server as the starter was due to the vinxi start command still being in experimentalphase and it doesn't really work that well
Brody
Brody4mo ago
doesnt seem to build locally, using node 22
✅ Processed route in 17ms
vite v5.3.5 building SSR bundle for production...
✓ 9 modules transformed.
x Build failed in 64ms

[3:22:30 PM] ERROR [tsr-routes-manifest] Could not load tsr:routes-manifest (imported by node_modules/@tanstack/start/dist/esm/router-manifest/index.js): Cannot read properties of undefined (reading 'map')
✅ Processed route in 17ms
vite v5.3.5 building SSR bundle for production...
✓ 9 modules transformed.
x Build failed in 64ms

[3:22:30 PM] ERROR [tsr-routes-manifest] Could not load tsr:routes-manifest (imported by node_modules/@tanstack/start/dist/esm/router-manifest/index.js): Cannot read properties of undefined (reading 'map')
Boxer
BoxerOP4mo ago
This is my repo and it builds fine that's weird https://github.com/eFnF/linker
GitHub
GitHub - eFnF/linker: An eFnF link shortener tool
An eFnF link shortener tool. Contribute to eFnF/linker development by creating an account on GitHub.
Brody
Brody4mo ago
[3:30:39 PM] ERROR [tsr-routes-manifest] Could not load tsr:routes-manifest (imported by node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]__rea_yl4fwum6lsr4zfzdcqzrmux4by/node_modules/@tanstack/start/dist/esm/router-manifest/index.js): Cannot read properties of undefined (reading 'map')
[3:30:39 PM] ERROR [tsr-routes-manifest] Could not load tsr:routes-manifest (imported by node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]__rea_yl4fwum6lsr4zfzdcqzrmux4by/node_modules/@tanstack/start/dist/esm/router-manifest/index.js): Cannot read properties of undefined (reading 'map')
Boxer
BoxerOP4mo ago
"it works on my machine" lol
Brody
Brody4mo ago
I'm using node 22 and pnpm 9.5.0
Boxer
BoxerOP4mo ago
same
No description
Brody
Brody4mo ago
I'm on 22.5.1
Boxer
BoxerOP4mo ago
im upgrading
Brody
Brody4mo ago
im downgrading nope
Boxer
BoxerOP4mo ago
yeah not sure, i upgraded and it works. I don't recall making changes on my end
Brody
Brody4mo ago
delete your node modules and install again
Boxer
BoxerOP4mo ago
yeah i did that as well
Brody
Brody4mo ago
oh well what build artifacts does running a build create
Boxer
BoxerOP4mo ago
it builds these 2 folders .output and .vinxi
No description
Brody
Brody4mo ago
are there any kind of server.js files or something in the build? something that starts the actual server and not a development server
Boxer
BoxerOP4mo ago
i believe it's the /.output/server/index.mjs file
No description
No description
Brody
Brody4mo ago
try having the start script start that then
Boxer
BoxerOP4mo ago
kk
Boxer
BoxerOP4mo ago
No description
Boxer
BoxerOP4mo ago
yeah it runs
No description
Boxer
BoxerOP4mo ago
i think thats what vinxi start does but i lose all my css etc
Brody
Brody4mo ago
is vinxi start is anything like vite that still runs a development server if it's more like next, then it runs a production server try running the entry then
Boxer
BoxerOP4mo ago
yeah running that one does not work
Brody
Brody4mo ago
well time to find out if vinxi start runs a development server
Boxer
BoxerOP4mo ago
yeah the docs are not great tbh
Starts a production server for your app. It looks for your recently built app in the appropriate directory based on the preset. By default, Vinxi uses the node-server preset, and looks for your app in the .output direction. You can change the preset being used using the --preset option or the SERVER_PRESET environment variable.
Starts a production server for your app. It looks for your recently built app in the appropriate directory based on the preset. By default, Vinxi uses the node-server preset, and looks for your app in the .output direction. You can change the preset being used using the --preset option or the SERVER_PRESET environment variable.
Brody
Brody4mo ago
Starts a production server for your app.
good enough for me
Boxer
BoxerOP4mo ago
GitHub
vinxi/packages/vinxi/bin/cli.mjs at main · nksaraf/vinxi
The Full Stack JavaScript SDK. Contribute to nksaraf/vinxi development by creating an account on GitHub.
Brody
Brody4mo ago
have the start command run it
Boxer
BoxerOP4mo ago
No description
Brody
Brody4mo ago
why is the css not loading in?
Boxer
BoxerOP4mo ago
about to scrap this 🤣 i feel like i'm wasting your time
Brody
Brody4mo ago
you're not but sort that css issue out and then let me know if you have issues running it on railway
Boxer
BoxerOP4mo ago
yeah it doesn't seem to be loading the js files for tailwind etc so the build stuff is sorted out?
Brody
Brody4mo ago
well not for me, but you can build it, so you need to sort out why the assets aren't loading
Boxer
BoxerOP4mo ago
bet ty hey so i figured out the asset loading issue so i reverted the railway settings to just use defaults but it still fails to build the image
Brody
Brody4mo ago
perfect, you need to specify the pnpm version - https://nixpacks.com/docs/providers/node#corepack
Boxer
BoxerOP4mo ago
nice that did it. now to figure out why it just loops the start command lol
No description
Brody
Brody4mo ago
are you on the V2 runtime?
Boxer
BoxerOP4mo ago
yes
Brody
Brody4mo ago
what's the state of the deployment
Boxer
BoxerOP4mo ago
active, it deployed successfully
Boxer
BoxerOP4mo ago
No description
Brody
Brody4mo ago
open the link?
Boxer
BoxerOP4mo ago
doesn't work i think since it keeps restarting
No description
Brody
Brody4mo ago
do you have a custom domain?
Boxer
BoxerOP4mo ago
Yeah, I also tried a railway domain and that did not work
celebrations
celebrations4mo ago
are you using cloudflare edit: yes you aer
celebrations
celebrations4mo ago
The ERR_TOO_MANY_REDIRECTS is caused by the TLS mode in cloudflare. Go to the domain you're using (efnf.io) on cloudflare. Then click "SSL/TLS" and set the encryption mode to "Full"
No description
Brody
Brody4mo ago
how did it not work though
Boxer
BoxerOP4mo ago
this did it :yeet:
Brody
Brody4mo ago
but how did the railway domain not work?
Boxer
BoxerOP4mo ago
oh i think i messed up i added the railway domain with the custom domain
Brody
Brody4mo ago
well all works now?
Boxer
BoxerOP4mo ago
yep thanks for all the help 🙏
Brody
Brody4mo ago
no problem! I'm curious, why did the assets not load?
Boxer
BoxerOP4mo ago
seems to be a vinxi bug, so the workaround is injecting the styles in the document. before i just imported the css file as is import "../globals.css"
No description
Boxer
BoxerOP4mo ago
GitHub
CSS Not in Initial Document for Prod Builds (Waterfalls) · Issue #7...
In dev mode, the initial document will render with CSS embedded When running a production build, CSS Modules are split out and fetched after initial document load (causing waterfall) I noticed this...
Brody
Brody4mo ago
gotcha
Want results from more Discord servers?
Add your server