R
Railway16mo ago
danfde

Error: Failed to parse Nixpacks config file `nixpacks.toml`

============== Using Nixpacks ==============  context: f032e9f2c589328ea1c2ba2d9660664c Nixpacks build failed  Error: Failed to parse Nixpacks config file nixpacks.toml  Caused by: redefinition of table packages for key packages at line 24 column 1
17 Replies
Percy
Percy16mo ago
Project ID: 3800ace0-d257-4ff7-94a3-52610b09dbcd
danfde
danfdeOP16mo ago
3800ace0-d257-4ff7-94a3-52610b09dbcd
Brody
Brody16mo ago
please send the nixpacks.toml file in question
danfde
danfdeOP16mo ago
https://nixpacks.com/docs/configuration/file ╔══════════════ Nixpacks v1.0.5 ══════════════╗ ║ setup │ nodejs-16_x, yarn-1_x, openssl ║ ║─────────────────────────────────────────────║ ║ install │ yarn install-prod ║ ║─────────────────────────────────────────────║ ║ build │ yarn run build ║ ║─────────────────────────────────────────────║ ║ start │ yarn run start ║ ╚═════════════════════════════════════════════╝ [phases.install] retry up to 5 times on fails cmds = ['for i in 1 2 3 4 5; do yarn run install-prod && break sleep 5; done'] [packages] nodejs = "18.x" [phases.build] cmds = ['for i in 1 2 3 4 5; do yarn run build && break sleep 5; done'] [start] cmd = 'yarn run start'
Configuration File Reference | Nixpacks
App source + Nix packages + Docker = Image
Brody
Brody16mo ago
please just send the nixpacks.toml file and enclose it in a code block
danfde
danfdeOP16mo ago
# https://nixpacks.com/docs/configuration/file


# ╔══════════════ Nixpacks v1.0.5 ══════════════╗
# ║ setup │ nodejs-16_x, yarn-1_x, openssl ║
# ║─────────────────────────────────────────────║
# ║ install │ yarn install-prod ║
# ║─────────────────────────────────────────────║
# ║ build │ yarn run build ║
# ║─────────────────────────────────────────────║
# ║ start │ yarn run start ║
# ╚═════════════════════════════════════════════╝

[phases.install]
# retry up to 5 times on fails
cmds = ['for i in 1 2 3 4 5; do yarn run install-prod && break || sleep 5; done']

[packages]
nodejs = "18.x"

[phases.build]
cmds = ['for i in 1 2 3 4 5; do yarn run build && break || sleep 5; done']

[start]
cmd = 'yarn run start'
# https://nixpacks.com/docs/configuration/file


# ╔══════════════ Nixpacks v1.0.5 ══════════════╗
# ║ setup │ nodejs-16_x, yarn-1_x, openssl ║
# ║─────────────────────────────────────────────║
# ║ install │ yarn install-prod ║
# ║─────────────────────────────────────────────║
# ║ build │ yarn run build ║
# ║─────────────────────────────────────────────║
# ║ start │ yarn run start ║
# ╚═════════════════════════════════════════════╝

[phases.install]
# retry up to 5 times on fails
cmds = ['for i in 1 2 3 4 5; do yarn run install-prod && break || sleep 5; done']

[packages]
nodejs = "18.x"

[phases.build]
cmds = ['for i in 1 2 3 4 5; do yarn run build && break || sleep 5; done']

[start]
cmd = 'yarn run start'
Brody
Brody16mo ago
why the retry loop
danfde
danfdeOP16mo ago
honestly not sure 🤔 i will ask do you think this will sove the issue Caused by: redefinition of table packages for key packages at line 24 column 1?
Brody
Brody16mo ago
no offense but this seems like something chatgpt would come up with
danfde
danfdeOP16mo ago
lol someone wrote this 11 months ago XD and left the company so maybe you are guessing right
Brody
Brody16mo ago
honestly I don't see the need for a nixpacks.toml file here if you want to use node 18, set engines.node to 18 in your package.json I have only been addressing the elephant in the room, but it's not valid because [packages] isn't a valid config
danfde
danfdeOP16mo ago
but still need the Nixpacks file right ?
Brody
Brody16mo ago
the retry loop is kinda silly tbh, so no you don't need a nixpacks.toml file in my opinion
danfde
danfdeOP16mo ago
thanks
Brody
Brody16mo ago
all good now?
danfde
danfdeOP16mo ago
yes thanks
Brody
Brody16mo ago
no prob 🙂
Want results from more Discord servers?
Add your server