Skip to content

Magidoc carbon-multi-page template build failure (missing +layout.ts / SvelteKit server build) #458

@MdKamranUddin25

Description

@MdKamranUddin25

Magidoc carbon-multi-page Template Build Failure (Windows / Node 22)

Summary

Attempting to generate documentation with Magidoc CLI using the carbon-multi-page template consistently fails during the SvelteKit build phase with a missing layout file error (v6.3.0) or a server build crash (v6.2.0). The GraphQL schema is successfully loaded; the failure occurs only while building the template after dependency installation.

Environment

Item Value
OS Windows 10/11 (PowerShell)
Node.js v22.19.0
Package Manager pnpm v10.22.0
Magidoc CLI versions tested 6.3.0, 6.2.0
Template carbon-multi-page (default / only supported named template)
GraphQL Server PostGraphile (running locally on http://localhost:5100/graphql)
Introspection Mode SDL file (./generated-docs/schema.graphql) and URL tried
Network Local only, no proxy

Minimal Configuration (magidoc.mjs)

export default {
  introspection: {
    type: 'sdl',
    paths: ['./generated-docs/schema.graphql'],
  },
  website: {
    template: 'carbon-multi-page',
    output: './generated-docs/magidoc',
    options: {
      appTitle: 'Commerce Plus Inventory Service API'
    }
  }
};

Also reproduced with:

introspection: { type: 'url', url: 'http://localhost:5100/graphql' }

Reproduction Steps

pnpm add -D @magidoc/cli@6.3.0
pnpm magidoc:generate --stacktrace

or (downgraded attempt):

pnpm add -D @magidoc/cli@6.2.0
pnpm magidoc:generate --stacktrace

Observed Output (v6.3.0)

✖ Build template
Error: Could not find file "src/routes/+layout.ts" in Vite manifest
    at resolve_symlinks (.../node_modules/@sveltejs/kit/src/exports/vite/build/utils.js:104:28)
    at build_server_nodes (.../node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js:103:40)
    at async analyse (.../node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:72:2)

Observed Output (v6.2.0)

error during build:
[vite-plugin-sveltekit-compile] Cannot read properties of undefined (reading 'file')
    at build_server_nodes (.../node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js:33:22)

What Works

  • Steps before build succeed:
    • Temporary template directory creation
    • Dependency installation (pnpm)
    • Schema loading (introspection succeeds)
    • Variables file writing
  • Failure is isolated to the SvelteKit/Vite server build for the template.

Expected Behavior

Template builds successfully, producing static documentation in ./generated-docs/magidoc.

Actual Behavior

Build aborts with an exception referencing missing SvelteKit route layout (v6.3.0) or an undefined property access within SvelteKit compile plugin (v6.2.0). No output directory is produced.

Additional Notes

  1. The template assets appear to be fetched into a temp directory (e.g. %LOCALAPPDATA%/Temp/carbon-multi-page@6.3.0). No src/routes/+layout.ts file exists in that directory post-fetch.
  2. Searching the installed packages shows no separate published package for @magidoc/starter-carbon-multi-page besides the fetched temp contents.
  3. Cannot locally patch the template because it is transient and not part of the repository; Magidoc does not expose a direct flag to persist/fork the starter before build.
  4. Other documentation generators in the same environment (Docusaurus, Spectaql, GraphDoc, GraphQL Voyager, Playground, GraphiQL) all work normally, suggesting environment is healthy.
  5. Node 22 may expose an edge case if template was validated primarily against Node 18/20; however, the error references missing assets rather than an unsupported runtime feature.

Hypothesis

The published starter template bundle is incomplete (missing layout entry file required by current SvelteKit build pipeline), or build scripts reference a file that was renamed/removed without updating internal manifest handling. The downgrade result (6.2.0) failing differently suggests a broader incompatibility or missing guard when enumerating server nodes.

###PLEASE HELP ON THIS ISSUE AS SOON AS POSSIBLE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions