# multi-stage build for svelte-monorepo
# Stage 1: build from source
FROM node:20-slim AS builder
WORKDIR /workspace
# Install pnpm globally
RUN npm install -g pnpm
# Install dependencies for the monorepo (root package.json)
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install
# Copy the rest of the repository and build
COPY . .
RUN pnpm run build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts and dependencies from builder
COPY --from=builder /workspace /app
# Expose nothing by default; this container demonstrates the built workspace
# Provide a simple default command to verify the image runs
CMD ["node", "-e", "console.log('svelte-monorepo container ready')"]
node_modules dist build *.log coverage .env *.tgz .DS_Store *.sqlite .cache .cache/** .idea .vscode *.lock pnpm-lock.yaml **/node_modules **/dist **/build
Summary (under 1500 chars): - Failing command/step: [builder 5/7] RUN pnpm install - Exact error message and exit code: Exit code: 1 3.225 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "svelte@workspace:^" is in the dependencies but no package named "svelte" is present in the workspace - Missing packages or files mentioned: - The workspace expects a package named "svelte" (svelte@workspace:^), but no such package is present in the workspace. - Version mismatch info: - npm notice New major version of npm available! 10.8.2 -> 11.12.0 - To update: npm install -g npm@11.12.0
# multi-stage build for svelte-monorepo
# Stage 1: build from source
FROM node:20-slim AS builder
WORKDIR /workspace
# Install pnpm globally
RUN npm install -g pnpm
# Install dependencies for the monorepo (root package.json)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install
# Copy the rest of the repository and build
COPY . .
RUN pnpm run build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts and dependencies from builder
COPY --from=builder /workspace /app
# Expose nothing by default; this container demonstrates the built workspace
# Provide a simple default command to verify the image runs
CMD ["node", "-e", "console.log('svelte-monorepo container ready')"]
- Exact error message and exit code: - ERROR: failed to build: failed to solve: failed to compute cache key: failed to calculate checksum of ref dm0crafjnw8l43ifl6uhde0ck::wdrds01k47mrvgbuhupkmsl9d: "/pnpm-lock.yaml": not found - Failing command/step: - [builder 4/7] COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./: - Missing packages or files mentioned: - /pnpm-lock.yaml not found - Note: CopyIgnoredFile shows pnpm-lock.yaml is excluded by .dockerignore (line 10) - Version mismatch info: - Base image used: node:20-slim@sha256:17281e8d1dc4d671976c6b89a12f47a44c2f390b63a989e2e327631041f544fd - No explicit version mismatch reported beyond the exclusion issue for pnpm-lock.yaml - Additional context: - The error indicates pnpm-lock.yaml is ignored by the dockerignore, yet the Dockerfile attempts to copy it, causing the checksum/cache key failure.
# Multi-stage build: build Svelte from source, then ship built artifacts
# Stage 1: build from source
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Install root dependencies (ignore workspace issues if any)
COPY package.json .
RUN pnpm install --ignore-workspace
# Copy the rest of the repository and build the svelte package
COPY . .
# Build only the svelte package to keep artifacts minimal
WORKDIR /workspace/packages/svelte
RUN pnpm install --ignore-workspace
RUN pnpm run build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy only the built artifacts from the builder to keep image lean
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
# Minimal startup message; can be replaced with a real entrypoint if desired
CMD ["node", "-e", "console.log('svelte-monorepo build complete')"]
Summary (under 1500 chars): - Exact error message and exit code: ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "svelte@workspace:^" is in the dependencies but no package named "svelte" is present in the workspace Exit code: 1 - Failing command/step: [builder 5/9] RUN pnpm install --ignore-workspace - Missing packages or files mentioned: The workspace is missing the svelte package referenced by the dependency spec "svelte@workspace:^" (no package named "svelte" is present in the workspace). This error occurred while installing a direct dependency of /workspace. - Version mismatch / notices: npm notice New major version of npm available! 10.8.2 -> 11.12.0 - Additional context from the log (relevant): This error happened while installing a direct dependency of /workspace
{
"name": "svelte-monorepo",
"version": "0.0.1",
"description": "monorepo for svelte and friends",
"private": true,
"type": "module",
"license": "MIT",
"packageManager": "pnpm@10.4.0",
"engines": {
"pnpm": ">=9.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sveltejs/svelte.git"
},
"scripts": {
"build": "pnpm -r --filter=./packages/* build",
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"lint": "eslint && prettier --check .",
"format": "prettier --write .",
"test": "vitest run",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
"changeset:publish": "changeset publish",
"bench": "NODE_ENV=production node --allow-natives-syntax ./benchmarking/run.js",
"bench:compare": "NODE_ENV=production node --allow-natives-syntax ./benchmarking/compare/index.js",
"bench:debug": "NODE_ENV=production node --allow-natives-syntax --inspect-brk ./benchmarking/run.js"
},
"devDependencies": {
"@changesets/cli": "^2.29.8",
"@eslint/js": "^10.0.0",
"@sveltejs/eslint-config": "^9.0.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^20.11.5",
"@types/picomatch": "^4.0.2",
"@vitest/coverage-v8": "^2.1.9",
"eslint": "^10.0.0",
"eslint-plugin-lube": "^0.5.1",
"eslint-plugin-svelte": "^3.15.0",
"jsdom": "25.0.1",
"playwright": "^1.58.0",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.4.0",
"svelte": "workspace:^",
"typescript": "^5.5.4",
"typescript-eslint": "^8.56.0",
"v8-natives": "^1.2.5",
"vitest": "^2.1.9"
}
}
packages: - 'packages/*' - 'playgrounds/*'
Summary of tool output (package.json for Svelte)
- Metadata
- name: svelte
- version: 5.55.0
- description: Cybernetically enhanced web apps
- license: MIT
- type: module
- engines: node >=18
- homepage: https://svelte.dev
- repository: git, url: git+https://github.com/sveltejs/svelte.git, directory: packages/svelte
- bugs: https://github.com/sveltejs/svelte/issues
- keywords: svelte, UI, framework, templates, templating
- Entry points
- main: src/index-client.js
- module: src/index-client.js
- Files included
- "*.d.ts", "src", "!src/**/*.test.*", "!src/**/*.d.ts", "types", "compiler", "README.md"
- Exports (selected mappings)
- ".": { types: "./types/index.d.ts", worker: "./src/index-server.js", browser: "./src/index-client.js", default: "./src/index-server.js" }
- "./package.json": "./package.json"
- "./action": { types: "./types/index.d.ts" }
- "./animate": { types: "./types/index.d.ts", default: "./src/animate/index.js" }
- "./attachments": { types: "./types/index.d.ts", default: "./src/attachments/index.js" }
- "./compiler": { types: "./types/index.d.ts", require: "./compiler/index.js", default: "./src/compiler/index.js" }
- "./easing": { types: "./types/index.d.ts", default: "./src/easing/index.js" }
- "./internal": { default: "./src/internal/index.js" }
- "./internal/client": { default: "./src/internal/client/index.js" }
- "./internal/disclose-version": { default: "./src/internal/disclose-version.js" }
- "./internal/flags/async": { default: "./src/internal/flags/async.js" }
- "./internal/flags/legacy": { default: "./src/internal/flags/legacy.js" }
- "./internal/flags/tracing": { default: "./src/internal/flags/tracing.js" }
- "./internal/server": { default: "./src/internal/server/index.js" }
- "./legacy": { types: "./types/index.d.ts", worker: "./src/legacy/legacy-server.js", browser: "./src/legacy/legacy-client.js", default: "./src/legacy/legacy-server.js" }
- "./motion": { types: "./types/index.d.ts", default: "./src/motion/index.js" }
- "./reactivity": { types: "./types/index.d.ts", worker: "./src/reactivity/index-server.js", browser: "./src/reactivity/index-client.js", default: "./src/reactivity/index-server.js" }
- "./reactivity/window": { types: "./types/index.d.ts", default: "./src/reactivity/window/index.js" }
- "./server": { types: "./types/index.d.ts", default: "./src/server/index.js" }
- "./store": { types: "./types/index.d.ts", worker: "./src/store/index-server.js", browser: "./src/store/index-client.js", default: "./src/store/index-server.js" }
- "./transition": { types: "./types/index.d.ts", default: "./src/transition/index.js" }
- "./events": { types: "./types/index.d.ts", default: "./src/events/index.js" }
- Imports
- "#client": "./src/internal/client/types.d.ts"
- "#client/constants": "./src/internal/client/constants.js"
- "#compiler": { types: "./src/compiler/private.d.ts", default: "./src/compiler/index.js" }
- "#compiler/builders": "./src/compiler/utils/builders.js"
- "#server": "./src/internal/server/types.d.ts"
- "#shared": "./src/internal/shared/types.d.ts"
- Scripts
- build: rollup -c && pnpm generate
- dev: node scripts/process-messages -w & rollup -cw
- check: tsc --project tsconfig.runtime.json && tsc && cd ./tests/types && tsc
- check:tsgo: tsgo --project tsconfig.runtime.json --skipLibCheck && tsgo --skipLibCheck
- check:watch: tsc --watch
- generate: node scripts/process-messages && node ./scripts/generate-types.js
- generate:version: node ./scripts/generate-version.js
- generate:types: node ./scripts/generate-types.js && tsc -p tsconfig.generated.json
- prepublishOnly: pnpm build && node scripts/check-treeshakeability.js
- knip: pnpm dlx knip
- DevDependencies (subset)
- "@jridgewell/trace-mapping": ^0.3.25
- "@playwright/test": ^1.58.0
- "@rollup/plugin-commonjs": ^28.0.1
- "@rollup/plugin-node-resolve": ^15.3.0
- "@rollup/plugin-terser": ^0.4.4
- "@rollup/plugin-virtual": ^3.0.2
- "@types/aria-query": ^5.0.4
- "@types/node": ^20.11.5
- "dts-buddy": ^0.5.5
- "esbuild": ^0.25.10
- "rollup": ^4.59.0
- "source-map": ^0.7.4
- "tinyglobby": ^0.2.12
- "typescript": ^5.5.4
- "vitest": ^2.1.9
- Dependencies (subset)
- "@jridgewell/remapping": ^2.3.4
- "@jridgewell/sourcemap-codec": ^1.5.0
- "@sveltejs/acorn-typescript": ^1.0.5
- "@types/estree": ^1.0.5
- "@types/trusted-types": ^2.0.7
- "acorn": ^8.12.1
- "aria-query": 5.3.1
- "axobject-query": ^4.1.0
- "clsx": ^2.1.1
- "devalue": ^5.6.4
- "esm-env": ^1.2.1
- "esrap": ^2.2.2
- "is-reference": ^3.0.3
- "locate-character": ^3.0.0
- "magic-string": ^0.30.11
- "zimmerframe": ^1.1.2
Notes
- The package exposes extensive subpath exports (browser, worker, server, default) and a dedicated internal/legacy/reactivity set.
- Includes import aliases for client/server/private typings and builders.
- Key entry point remains src/index-client.js; server-side server/legacy paths exist for SSR or worker builds.# Multi-stage build: build only the svelte package from its directory to avoid monorepo workspace issues
FROM node:20-slim AS builder
WORKDIR /workspace
# Install build tools
RUN apt-get update && apt-get install -y --no-install-recommends make g++ python3 && rm -rf /var/lib/apt/lists/*
# Install PNPM
RUN npm install -g pnpm
# Copy only the svelte package to build
COPY --chown=root:root packages/svelte ./packages/svelte
WORKDIR /workspace/packages/svelte
# Install dependencies and build the svelte package
RUN pnpm install
RUN pnpm run build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from builder
COPY --from=builder /workspace/packages/svelte/compiler ./compiler
# Provide a simple startup message
CMD ["node", "-e", "console.log('svelte package built for container')"]
- Failing command/step: - Builder step 8/8: RUN pnpm run build - Exact error message and exit code: - Error: ENOENT: no such file or directory, mkdir '../../documentation/docs/98-reference/.generated' - code: ENOENT - errno: -2 - Exit code: 1 - Node.js v20.20.1 - Context in the log: - The error occurs during the generate phase of the Svelte package build (pnpm run build), after an “ELIFECYCLE” indicating exit code 1. - Missing packages or files mentioned: - Missing/non-existent path: ../../documentation/docs/98-reference/.generated (relative to /workspace/packages/svelte/scripts/process-messages/index.js) - This implies the parent directory documentation/docs/98-reference may be missing, preventing mkdir. - Version mismatch / dependency notes: - Unmet peer dependency: dts-buddy 0.5.5 has unmet peer typescript@">=5.0.4 <5.8": found 5.9.3 - Node.js version: v20.20.1 - pnpm version: v10.32.1 (shown in log) - Additional version hints: TypeScript 5.9.3 installed; 6.0.2 available; npm major version upgrade available (10.8.2 -> 11.12.0) but not directly related to this error - Summary: The build fails at the pnpm run build step due to ENOENT mkdir attempting to create the .generated folder under documentation/docs/98-reference, which likely doesn't exist. A related version mismatch exists where dts-buddy requires TypeScript <5.8, but TypeScript 5.9.3 is present.
# Multi-stage build: build the monorepo from source and ship built artifacts
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Copy manifests first to leverage Docker cache
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
# Install root dependencies and workspace setup
RUN pnpm install
# Copy the rest of the repository
COPY . .
# Build the svelte package (only)
RUN pnpm -w --filter ./packages/svelte build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from builder
COPY --from=builder /workspace /app
# Default command: verify container runs
CMD ["node", "-e", "console.log('svelte-monorepo built from source in container')"]
- Exact error message and exit code - Error: ERROR: failed to build: failed to solve: failed to calculate cache key: failed to calculate checksum of ref dm0crafjnw8l43ifl6uhde0ck::psha7q1d0t45wjsinp35yvscs: "/pnpm-lock.yaml": not found - Exit code: not shown in the log - Failing command/step - [builder 4/7] COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./: - Missing packages or files mentioned - pnpm-lock.yaml not found in the build context - Warning indicates pnpm-lock.yaml is excluded by .dockerignore (line 9): CopyIgnoredFile: Attempting to Copy file "pnpm-lock.yaml" that is excluded by .dockerignore (line 9) - Context shows COPY of pnpm-lock.yaml but the file is missing or ignored - Version mismatch info - Base image used: node:20-slim (sha256:17281e8d1dc4d671976c6b89a12f47a44c2f390b63a989e2e327631041f544fd) - No explicit version mismatch reported - Quick note - Ensure pnpm-lock.yaml exists in the build context and is not excluded by .dockerignore, or adjust the Dockerfile to copy only existing files.
# Final attempt: lean multi-stage build using a workspace-aware approach
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Copy root manifests first (pnpm-workspace.yaml and package.json) to install workspace
COPY package.json pnpm-workspace.yaml ./
# Do not copy pnpm-lock.yaml here if it's not present in this repo snapshot, to avoid dockerignore issues
RUN pnpm install --ignore-workspace
# Copy the rest of the repo
COPY . .
# Build only the svelte package
RUN pnpm -w --filter ./packages/svelte build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from builder (adjust to actual build output directories)
COPY --from=builder /workspace/packages/svelte/dist /app/dist
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
CMD ["node", "-e", "console.log('svelte-monorepo built from source in container')"]
Summary (under 1500 chars): - Failing command/step: [builder 5/7] RUN pnpm install --ignore-workspace (Dockerfile:12) - Exit code: 1 - Exact error message: ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "svelte@workspace:^" is in the dependencies but no package named "svelte" is present in the workspace This error happened while installing a direct dependency of /workspace Packages found in the workspace: - Missing packages or files mentioned: svelte is declared in the workspace dependencies but no package named "svelte" exists in the workspace - Version mismatch info: npm notice New major version of npm available! 10.8.2 -> 11.12.0
# Multi-stage build: build from source, then ship built artifacts
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Copy the entire repository into the builder image
COPY . .
# Install dependencies and build the svelte package (and the monorepo)
RUN pnpm install
RUN pnpm -w --filter ./packages/svelte build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from builder
COPY --from=builder /workspace /app/workspace
# Simple startup message to verify container works
CMD ["node", "-e", "console.log('svelte-monorepo build complete')"]
Concerns: The runtime image only prints a startup message and does not actually run the built application; the CMD is not starting any server or executable., The build output location is assumed (build/ dist/ public) and may vary between monorepo configurations; smoke tests rely on these paths existing, which may not always be the case. Smoke [FAIL]: sh -c '([ -d /app/workspace/packages/svelte/build ] || [ -d /app/workspace/packages/svelte/dist ] || [ -d /app/workspace/packages/svelte/public ]) Output: sh: 1: Syntax error: Unterminated quoted string Smoke [PASS]: node -v Smoke [PASS]: ls -la /app/workspace/packages/svelte | head -n 5
# Multi-stage build: build the monorepo from source, then ship built artifacts
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Copy manifests first to install workspace dependencies
COPY package.json pnpm-workspace.yaml ./
# Install dependencies for the workspace
RUN pnpm install
# Copy the rest of the repository
COPY . .
# Build the svelte package (and the monorepo)
RUN pnpm -w --filter ./packages/svelte build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy the built workspace from the builder into the runtime image
COPY --from=builder /workspace /app/workspace
CMD ["node", "-e", "console.log('svelte-monorepo build complete')"]
Summary of Docker build error - Failing command/step: [builder 5/7] RUN pnpm install - Exact error message and exit code: 2.015 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "svelte@workspace:^" is in the dependencies but no package named "svelte" is present in the workspace This error happened while installing a direct dependency of /workspace Packages found in the workspace: ERROR: failed to build: failed to solve: process "/bin/sh -c pnpm install" did not complete successfully: exit code: 1 - Missing packages or files mentioned: - svelte is declared as "svelte@workspace:^" in dependencies, but no package named "svelte" is present in the workspace - Version mismatch / notices: - New major version of npm available! 10.8.2 -> 11.12.0 - To update run: npm install -g npm@11.12.0
# Multi-stage build: build the svelte package in isolation, then ship built artifacts
FROM node:20-slim AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Ensure required docs path exists for the build script that touches it
RUN mkdir -p /workspace/documentation/docs/98-reference
# Copy only the svelte package to build (avoids monorepo workspace issues)
COPY packages/svelte ./packages/svelte
WORKDIR /workspace/packages/svelte
# Install dependencies for the svelte package and build
RUN pnpm install
RUN pnpm run build
# Stage 2: runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from the builder
COPY --from=builder /workspace/packages/svelte ./packages/svelte
CMD ["node", "-e", "console.log('svelte-monorepo build complete')"]
Concerns: The final runtime CMD only prints a message and does not run the built application. Consider wiring the built artifacts to a real start command if this image is intended to serve the app.
Smoke [FAIL]: node -e \"console.log('svelte-monorepo build complete')\
Output: sh: 1: Syntax error: "(" unexpected
Smoke [PASS]: test -f /app/packages/svelte/package.json && echo OK || echo MISSING
Smoke [PASS]: node -v | grep -q '^v20' && echo OK || echo NOT20# Multi-stage build: build the monorepo from source
FROM node:20 AS builder
WORKDIR /workspace
# Install PNPM
RUN npm install -g pnpm
# Copy manifest files first to leverage Docker layer caching
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
# Install dependencies for the workspace
RUN pnpm install
# Copy the rest of the repository and build all packages
COPY . .
RUN pnpm run build
# Runtime image
FROM node:20-slim
WORKDIR /app
# Copy built artifacts from builder
COPY --from=builder /workspace /app
# Simple startup to verify container runs
CMD ["node", "-e", "console.log('svelte-monorepo container ready')"]
# Multi-stage build for Svelte monorepo
# Builder stage
FROM node:20-slim AS builder
WORKDIR /workspace
# Install minimal system deps
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the preferred PNPM version globally
RUN npm install -g pnpm@10.4.0
# Copy package manifests first for caching (keep this minimal)
COPY package.json .
COPY .npmrc* . 2>/dev/null || true
# Copy workspace config if present
COPY pnpm-workspace.yaml* . 2>/dev/null || true
# Install dependencies (no lockfile assumed in this simplified build context)
RUN pnpm install || pnpm install --no-frozen-lockfile
# Copy all source for build
COPY . .
# Build the monorepo (this will run in workspace mode)
RUN pnpm build
# Runtime stage
FROM node:20-slim AS runtime
WORKDIR /app
# Copy only the built artifacts to keep the final image lean
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
# Provide a runnable entrypoint. Run the built compiler index.js when starting the container.
# If the artifact requires more runtime setup in the future, adjust here.
CMD ["node", "compiler/index.js"]
Concerns: COPY instructions contain shell redirection and conditional logic (2>/dev/null || true) which is invalid in Dockerfile syntax for COPY; this will cause a build failure., Likely missing or misnamed build artifact path: the final runtime COPY expects /workspace/packages/svelte/compiler to exist; build output location may differ depending on pnpm workspaces config and build script., Potentially fragile build cache strategy: copying .npmrc* and pnpm-workspace.yaml* with wildcards may fail in contexts where those files are absent; the current syntax attempts to silence errors which isn't valid for Dockerfile COPY., ENTRYPOINT/CMD relies on the artifact at compiler/index.js; if the build step changes location or file names, the runtime CMD will fail.
# Multi-stage build for Svelte monorepo
# Builder stage
FROM node:20-slim AS builder
WORKDIR /workspace
# Install minimal system deps
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the preferred PNPM version globally
RUN npm install -g pnpm@10.4.0
# Copy package manifests first for caching (best effort)
COPY package.json pnpm-workspace.yaml* ./
COPY .npmrc* . 2>/dev/null || true
# Install dependencies
RUN pnpm install --frozen-lockfile || pnpm install
# Copy all source for build
COPY . .
# Build the monorepo (this will run in workspace mode)
RUN pnpm build
# Runtime stage
FROM node:20-slim AS runtime
WORKDIR /app
# Copy built artifacts to a lean runtime image
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
# Run a small smoke test when container starts (optional). Here we just print a message.
CMD ["node", "/app/compiler/index.js"]
Exact error message and exit code - Exit code: 1 - Error: cannot copy to non-directory: /var/lib/docker/buildkit/containerd-overlayfs/cachemounts/buildkit341481696/workspace/true Failing command/step - [builder 6/9] COPY .npmrc* . 2>/dev/null || true - Dockerfile: line 20 - Context: The COPY instruction includes shell redirection and a conditional "|| true", which BuildKit treats as part of COPY, leading to trying to copy to a path ending in "true" and failing with “cannot copy to non-directory”. Missing packages or files mentioned - None specified as missing. The error is caused by the COPY instruction with shell syntax, not a missing package/file. Version mismatch info - Base image: node:20-slim - PNPM installed: pnpm@10.4.0 (via npm -g) - NPM notice: New major version of npm available! 10.8.2 -> 11.12.0 - Other observed: apt-get installs occurred for Debian bookworm, but no explicit version mismatch noted beyond the npm update notice.
# Multi-stage build for Svelte monorepo
# Builder stage
FROM node:20-slim AS builder
WORKDIR /workspace
# Install minimal system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the preferred PNPM version globally
RUN npm install -g pnpm@10.4.0
# Copy manifests first for caching
COPY package.json pnpm-workspace.yaml ./
# Install dependencies (prefer frozen lockfile if present)
RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; else pnpm install; fi
# Copy the rest of the source for the build
COPY . .
# Build the monorepo (this will run in workspace mode)
RUN pnpm build
# Runtime stage
FROM node:20-slim AS runtime
WORKDIR /app
# Copy built artifacts to a lean runtime image
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
# Run the built compiler at container start
CMD ["node", "/app/compiler/index.js"]
- Exact error message and exit code - Error: ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In : "svelte@workspace:^" is in the dependencies but no package named "svelte" is present in the workspace - Exit code: 1 - Failing command/step - [builder 6/8] RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; else pnpm install; fi - Missing packages or files mentioned - The workspace declares a dependency on "svelte" (svelte@workspace:^), but no package named "svelte" is present in the workspace - Version mismatch info - pnpm version used: 10.4.0 (from npm install -g pnpm@10.4.0) - Base image: node:20-slim - No explicit version mismatch noted; error arises from missing workspace package rather than a version conflict
# Multi-stage build for Svelte monorepo
# Builder stage
FROM node:20-slim AS builder
WORKDIR /workspace
# Install minimal system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the preferred PNPM version globally
RUN npm install -g pnpm@10.4.0
# Copy manifests first for caching purposes
COPY package.json pnpm-workspace.yaml ./
# Copy the rest of the repository
COPY . .
# Install dependencies (respect workspace layout)
RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; else pnpm install; fi
# Build the monorepo
RUN pnpm build
# Runtime stage
FROM node:20-slim AS runtime
WORKDIR /app
# Copy built artifacts to lean runtime image
COPY --from=builder /workspace/packages/svelte/compiler /app/compiler
# Run the built compiler at container start
CMD ["node", "/app/compiler/index.js"]
Concerns: Build output path assumption: /workspace/packages/svelte/compiler/index.js may differ depending on the build script; if the actual entry point is elsewhere (e.g., dist/index.js or /build/index.js), the runtime CMD will fail. Smoke [PASS]: test -f /app/compiler/index.js Smoke [PASS]: node /app/compiler/index.js