build stuck on load metadata

My project is stuck building these are the logs:
==============
Using Nixpacks
==============
context: 13a5a08983d3574fbc4758882d67dbac

╔══════════════════ Nixpacks v1.5.1 ═════════════════╗
║ setup │ nodejs-16_x, npm-8_x, openssl ║
║────────────────────────────────────────────────────║
║ install │ npm ci ║
║────────────────────────────────────────────────────║
║ build │ npx nx run app:build ║
║────────────────────────────────────────────────────║
║ start │ npx nx run app:preview --host 0.0.0.0 ║
╚════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.23kB done

#1 DONE 0.2s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.2s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1678752204
==============
Using Nixpacks
==============
context: 13a5a08983d3574fbc4758882d67dbac

╔══════════════════ Nixpacks v1.5.1 ═════════════════╗
║ setup │ nodejs-16_x, npm-8_x, openssl ║
║────────────────────────────────────────────────────║
║ install │ npm ci ║
║────────────────────────────────────────────────────║
║ build │ npx nx run app:build ║
║────────────────────────────────────────────────────║
║ start │ npx nx run app:preview --host 0.0.0.0 ║
╚════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.23kB done

#1 DONE 0.2s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.2s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1678752204
54 Replies
Percy
Percy2y ago
Project ID: 6d888c30-44bb-4d6c-8df0-b37ecd39e975
heelgrappigdennis
6d888c30-44bb-4d6c-8df0-b37ecd39e975
Brody
Brody2y ago
just abort it and try again. also, this isn't causing the problem you are currently seeing but, please don't run your app in preview/dev mode on railway, it will just be headaches
heelgrappigdennis
thnx for the tip
Brody
Brody2y ago
slower response times, increase in ram and cpu, instabilities
inotmad
inotmad2y ago
retrying doesnt work for me
Brody
Brody2y ago
okay, i have notified the team
heelgrappigdennis
same here I checked but its weird naming preview is the production build
Brody
Brody2y ago
this is a mono repo right?
heelgrappigdennis
yes
heelgrappigdennis
/* * WHAT IS THIS FILE? * * It's the bundle entry point for npm run preview. * That is, serving your app built in production mode. * * Feel free to modify this file, but don't remove it! * * Learn more about Vite's preview command: * - https://vitejs.dev/config/preview-options.html#preview-options * */
Vite
Next Generation Frontend Tooling
Brody
Brody2y ago
what framework are you using?
heelgrappigdennis
qwik but with nx-qwik
Brody
Brody2y ago
does it build a spa? that does client side routing
heelgrappigdennis
yes but without downloading the whole spa from the start
Brody
Brody2y ago
does the build folder only contain a single html file?
heelgrappigdennis
the build folder "dist" doesnt have a html file
Brody
Brody2y ago
interesting I have no experience with qwik, so I will look into an appropriate way to run your app in production mode on railway and get back to you on that the two support engineers aren't active right now, so please be patient and sorry for any inconvenience this may have caused
heelgrappigdennis
Its fine but qwik is really fun would really recommend it
Brody
Brody2y ago
yes really fun
Brody
Brody2y ago
ive never seen docs for a framework that tell the user to figure it out themselves
heelgrappigdennis
hahaha I feel like thats because qwik is very new (1.0 is out for just a month) these rough edges will improve over time but its pretty weird indeed my problem with the build stuck on metadata is fixed its still building but it is going further than before
Brody
Brody2y ago
can you show me a screenshot of your service metrics?
heelgrappigdennis
sure
heelgrappigdennis
may 21 until now
Brody
Brody2y ago
please show me the service metrics from the metrics tab of your service set to 6h
Brody
Brody2y ago
oof thats what 550mb? this is why you dont run preview/dev servers on railway
heelgrappigdennis
but the dev command is a different one i get that its a lot
Brody
Brody2y ago
dev or preview, they mean the same thing essentially 1. run npm run qwik add express 2. cut and paste the start command into the dev command 3. cut and paste the serve command into the start command 4. remove the now empty serve script 5. push changes to github 6. ram usage should now be under 100mb!!
heelgrappigdennis
I will look into it
Brody
Brody2y ago
please do, 550mb is absurd
heelgrappigdennis
@Brody Since I used nx it took a few extra steps but i got it to work and indeed its a lot better now. thnx for pointing it out to me
heelgrappigdennis
now its like 210
Brody
Brody2y ago
that's still quite a bit, do you mind sharing your package.json for the qwik app?
heelgrappigdennis
Sure
{
"name": "com-toolsensei",
"dependencies": {
"@prisma/client": "^4.14.1",
"file-saver": "^2.0.5",
"html5-qrcode": "^2.3.8",
"qrcode": "^1.5.3",
"qwik-nx": "1.0.3",
"uuid": "^9.0.0"
},
"devDependencies": {
"@auth/core": "^0.7.1",
"@builder.io/qwik": "~1.1.1",
"@builder.io/qwik-auth": "~0.1.0",
"@builder.io/qwik-city": "~1.1.1",
"@modular-forms/qwik": "^0.13.0",
"@next-auth/prisma-adapter": "^1.0.6",
"@nx/eslint-plugin": "16.1.4",
"@nx/js": "16.1.4",
"@nx/linter": "16.1.4",
"@nx/vite": "16.1.4",
"@nx/workspace": "16.1.4",
"@types/compression": "^1.7.2",
"@types/express": "^4.17.17",
"@types/file-saver": "^2.0.5",
"@types/qrcode": "^1.5.0",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/ui": "^0.31.0",
"autoprefixer": "~10.4.11",
"clsx": "^1.2.1",
"compression": "^1.7.4",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-qwik": "~1.1.1",
"express": "^4.18.2",
"jsdom": "~20.0.3",
"node-fetch": "~3.3.0",
"nx": "16.1.4",
"nx-cloud": "latest",
"postcss": "~8.4.16",
"prettier": "^2.6.2",
"prisma": "^4.14.1",
"qwik-speak": "^0.14.0",
"sass": "~1.56.1",
"tailwindcss": "~3.1.8",
"typescript": "~5.0.2",
"undici": "^5.22.0",
"vite": "^4.3.5",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "~4.2.0",
"vitest": "^0.31.0"
}
}
{
"name": "com-toolsensei",
"dependencies": {
"@prisma/client": "^4.14.1",
"file-saver": "^2.0.5",
"html5-qrcode": "^2.3.8",
"qrcode": "^1.5.3",
"qwik-nx": "1.0.3",
"uuid": "^9.0.0"
},
"devDependencies": {
"@auth/core": "^0.7.1",
"@builder.io/qwik": "~1.1.1",
"@builder.io/qwik-auth": "~0.1.0",
"@builder.io/qwik-city": "~1.1.1",
"@modular-forms/qwik": "^0.13.0",
"@next-auth/prisma-adapter": "^1.0.6",
"@nx/eslint-plugin": "16.1.4",
"@nx/js": "16.1.4",
"@nx/linter": "16.1.4",
"@nx/vite": "16.1.4",
"@nx/workspace": "16.1.4",
"@types/compression": "^1.7.2",
"@types/express": "^4.17.17",
"@types/file-saver": "^2.0.5",
"@types/qrcode": "^1.5.0",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitest/coverage-c8": "^0.31.0",
"@vitest/ui": "^0.31.0",
"autoprefixer": "~10.4.11",
"clsx": "^1.2.1",
"compression": "^1.7.4",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-qwik": "~1.1.1",
"express": "^4.18.2",
"jsdom": "~20.0.3",
"node-fetch": "~3.3.0",
"nx": "16.1.4",
"nx-cloud": "latest",
"postcss": "~8.4.16",
"prettier": "^2.6.2",
"prisma": "^4.14.1",
"qwik-speak": "^0.14.0",
"sass": "~1.56.1",
"tailwindcss": "~3.1.8",
"typescript": "~5.0.2",
"undici": "^5.22.0",
"vite": "^4.3.5",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "~4.2.0",
"vitest": "^0.31.0"
}
}
Brody
Brody2y ago
interesting can i see the main package.json too? or wherever you have the qwik start command
heelgrappigdennis
this is the main package.json the commands are in project.json that one looks like this:
{
"name": "dashboard",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/dashboard/src",
"targets": {
"build": {
"executor": "qwik-nx:build",
"options": {
"runSequence": ["dashboard:build.client", "dashboard:build.ssr"],
"outputPath": "dist/apps/dashboard"
},
"configurations": {
"preview": {},
"production": {}
}
},
"build.client": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/apps/dashboard",
"configFile": "apps/dashboard/vite.config.ts"
}
},
"build.ssr": {
"executor": "@nx/vite:build",
"defaultConfiguration": "preview",
"options": {
"outputPath": "dist/apps/dashboard"
},
"configurations": {
"preview": {
"ssr": "src/entry.preview.tsx",
"mode": "production"
},
"production": {
"configFile": "apps/dashboard/adapters/express/vite.config.ts"
}
}
},
{
"name": "dashboard",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/dashboard/src",
"targets": {
"build": {
"executor": "qwik-nx:build",
"options": {
"runSequence": ["dashboard:build.client", "dashboard:build.ssr"],
"outputPath": "dist/apps/dashboard"
},
"configurations": {
"preview": {},
"production": {}
}
},
"build.client": {
"executor": "@nx/vite:build",
"options": {
"outputPath": "dist/apps/dashboard",
"configFile": "apps/dashboard/vite.config.ts"
}
},
"build.ssr": {
"executor": "@nx/vite:build",
"defaultConfiguration": "preview",
"options": {
"outputPath": "dist/apps/dashboard"
},
"configurations": {
"preview": {
"ssr": "src/entry.preview.tsx",
"mode": "production"
},
"production": {
"configFile": "apps/dashboard/adapters/express/vite.config.ts"
}
}
},
"preview": {
"executor": "@nx/vite:preview-server",
"options": {
"buildTarget": "dashboard:build",
"port": 4300
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["../../coverage/apps/dashboard"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/dashboard"
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"options": {
"buildTarget": "dashboard:build.client",
"mode": "ssr",
"port": 4200
}
},
"serve.express": {
"executor": "nx:run-commands",
"options": {
"commands": ["npx nx run dashboard:build:production", "node dist/apps/dashboard/server/entry.express"],
"parallel": false
}
},
"serve.debug": {
"executor": "nx:run-commands",
"options": {
"command": "node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force",
"cwd": "apps/dashboard"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/dashboard/**/*.{ts,tsx,js,jsx}"]
}
}
},
"tags": []
}
"preview": {
"executor": "@nx/vite:preview-server",
"options": {
"buildTarget": "dashboard:build",
"port": 4300
}
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["../../coverage/apps/dashboard"],
"options": {
"passWithNoTests": true,
"reportsDirectory": "../../coverage/apps/dashboard"
}
},
"serve": {
"executor": "@nx/vite:dev-server",
"options": {
"buildTarget": "dashboard:build.client",
"mode": "ssr",
"port": 4200
}
},
"serve.express": {
"executor": "nx:run-commands",
"options": {
"commands": ["npx nx run dashboard:build:production", "node dist/apps/dashboard/server/entry.express"],
"parallel": false
}
},
"serve.debug": {
"executor": "nx:run-commands",
"options": {
"command": "node --inspect-brk ../../node_modules/vite/bin/vite.js --mode ssr --force",
"cwd": "apps/dashboard"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/dashboard/**/*.{ts,tsx,js,jsx}"]
}
}
},
"tags": []
}
on prod i run serve.express
Brody
Brody2y ago
and how are telling railway to run serve.express?
heelgrappigdennis
npx nx run dashboard:serve.express --host:0.0.0.0
Brody
Brody2y ago
and you just set that as the start command in the service settings?
heelgrappigdennis
i need to improve the watch paths
Brody
Brody2y ago
correct me if im wrong, but doesnt that build twice??
heelgrappigdennis
yes it does
Brody
Brody2y ago
why is that desirable?
heelgrappigdennis
no just a mistake
Brody
Brody2y ago
all you would have to do is remove this, right?
heelgrappigdennis
yes im going to give it a try one of the 2 was at 269 before and went to 208, the other was at 190 and went to 195
Brody
Brody2y ago
aside from building twice, as far as i can tell you are running it correctly, so it is what it is the joys of JavaScript
heelgrappigdennis
Its worth it for me 🙂 Thnx for your help
Brody
Brody2y ago
so all is good?
heelgrappigdennis
Yes perfect
Brody
Brody2y ago
awsome
Want results from more Discord servers?
Add your server