railwayapp / nixpacks

App source + Nix packages + Docker = Image
https://nixpacks.com
MIT License
2.47k stars 232 forks source link

Nixpacks Bug Report #978

Closed lomithrani closed 11 months ago

lomithrani commented 11 months ago

Is there an existing issue for this?

Describe the bug

Trying to deploy a sveltekit app with bun

For reference building works fine in Debian GNU/Linux 12 (bookworm) with bun version 1.0.3

To reproduce

Can't reproduce on local machine but can give you the code: https://github.com/lomithrani/portfolio.git (Client)

[Region: us-west1]

==============

Using Nixpacks

==============

context: f49990680715cc0c2ee461fa172b0b02

╔════════════════════ Nixpacks v1.16.0 ════════════════════╗

║ setup      │ bun                                         ║

║──────────────────────────────────────────────────────────║

║ install    │ bun i --no-save                             ║

║──────────────────────────────────────────────────────────║

║ build      │ bun run build                               ║

║──────────────────────────────────────────────────────────║

║ start      │ PORT=${PORT:-4000} bun --bun build/index.js ║

╚══════════════════════════════════════════════════════════╝

#0 building with "default" instance using docker driver

#1 [internal] load .dockerignore

#1 transferring context: 2B done

#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile

#2 transferring dockerfile: 2.44kB done

#2 DONE 0.0s

#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1695081795

#3 DONE 0.3s

#4 [stage-0  1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1695081795@sha256:861b494e331a1102d04519741af1e4d8960da8314c21c39b8ad8b7c161ee4c98

#4 DONE 0.0s

#5 [internal] load build context

#5 transferring context: 764.69kB done

#5 DONE 0.0s

#6 [stage-0  2/10] WORKDIR /app/

#6 CACHED

#7 [stage-0  3/10] COPY .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix

#7 CACHED

#8 [stage-0  4/10] RUN nix-env -if .nixpacks/nixpkgs-5148520bfab61f99fd25fb9ff7bfbb50dad3c9db.nix && nix-collect-garbage -d

#8 CACHED

#9 [stage-0  5/10] COPY . /app/.

#9 DONE 0.0s

#10 [stage-0  6/10] RUN --mount=type=cache,id=s/db3d1d13-0016-4a56-a8b1-f33e6c3395e4-/root/bun,target=/root/.bun bun i --no-save

#10 0.316 bun install v1.0.2 (37edd5a6)

#10 2.646  + @fontsource/fira-mono@4.5.10

#10 2.646  + @neoconfetti/svelte@1.0.0

#10 2.646  + @playwright/test@1.38.1

#10 2.646  + @sveltejs/adapter-auto@2.1.0

#10 2.646  + @sveltejs/kit@1.25.0

#10 2.646  + @types/cookie@0.5.2

#10 2.646  + @typescript-eslint/eslint-plugin@6.7.2

#10 2.646  + @typescript-eslint/parser@6.7.2

#10 2.646  + elysia@0.7.12

#10 2.646  + eslint@8.50.0

#10 2.646  + eslint-config-prettier@8.10.0

#10 2.646  + eslint-plugin-svelte@2.33.2

#10 2.646  + prettier@2.8.8

#10 2.646  + prettier-plugin-svelte@2.10.1

#10 2.646  + svelte@4.2.1

#10 2.646  + svelte-adapter-bun@0.5.0

#10 2.646  + svelte-check@3.5.2

#10 2.646  + tslib@2.6.2

#10 2.646  + typescript@5.2.2

#10 2.646  + vite@4.4.9

#10 2.646  + vitest@0.32.4

#10 2.646  + @elysiajs/eden@0.7.2

#10 2.647

#10 2.647  275 packages installed [2.34s]

#10 DONE 2.8s

#11 [stage-0  7/10] COPY . /app/.

#11 DONE 0.0s

#12 [stage-0  8/10] RUN --mount=type=cache,id=s/db3d1d13-0016-4a56-a8b1-f33e6c3395e4-node_modules/cache,target=/app/node_modules/.cache bun run build

#12 0.349 $ vite build

#12 0.734 ▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

#12 0.734

#12 0.734     tsconfig.json:2:12:

#12 0.734       2 │   "extends": "./.svelte-kit/tsconfig.json",

#12 0.734         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#12 0.734

#12 2.072 error during build:

#12 2.072 undefined

2.094 error: script "build" exited with code 1 (SIGHUP)
-----

Expected behavior

build step should succeed and produce build folder and js files

Environment

Nixpacks v1.16.0

Package.json

{
  "name": "portfolio-client",
  "version": "0.0.1",
  "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview",
    "test": "npm run test:integration && npm run test:unit",
    "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
    "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
    "lint": "prettier --plugin-search-dir . --check . && eslint .",
    "format": "prettier --plugin-search-dir . --write .",
    "test:integration": "playwright test",
    "test:unit": "vitest"
  },
  "devDependencies": {
    "@fontsource/fira-mono": "^4.5.10",
    "@neoconfetti/svelte": "^1.0.0",
    "@playwright/test": "^1.28.1",
    "@sveltejs/adapter-auto": "^2.0.0",
    "@sveltejs/kit": "^1.20.4",
    "@types/cookie": "^0.5.1",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "elysia": "^0.7.12",
    "eslint": "^8.28.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-svelte": "^2.30.0",
    "prettier": "^2.8.0",
    "prettier-plugin-svelte": "^2.10.1",
    "svelte": "^4.0.5",
    "svelte-adapter-bun": "^0.5.0",
    "svelte-check": "^3.4.3",
    "tslib": "^2.4.1",
    "typescript": "^5.0.0",
    "vite": "^4.4.2",
    "vitest": "^0.32.2"
  },
  "type": "module",
  "dependencies": {
    "@elysiajs/eden": "^0.7.2"
  }
}

svelte.config.json

//import adapter from '@sveltejs/adapter-auto';
import adapter from "@sveltejs/adapter-node";

import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
    // Consult https://kit.svelte.dev/docs/integrations#preprocessors
    // for more information about preprocessors
    preprocess: vitePreprocess(),

    kit: {
        // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
        // If your environment is not supported or you settled on a specific environment, switch out the adapter.
        // See https://kit.svelte.dev/docs/adapters for more information about adapters.
        adapter: adapter()
    }
};

export default config;
lomithrani commented 11 months ago

Sorry re reading the svelte.config.json I realized that I had not change the import ... All good sorry