Skip to content

Database schema from multiple layers doesn't get merged on build output #866

@TheBITLINK

Description

@TheBITLINK

Describe the bug
When building a multi-layer project, the @nuxthub/db/schema package generated inside .output/server only contains schemas from a single layer.

As a workaround, I added this to my Dockerfile to copy the module from the main node_modules (outside .output), which is correctly merged:

COPY --from=build /app/node_modules/@nuxthub/db/ ./server/node_modules/@nuxthub/db/

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a new Nuxt layer inside the layers directory
  2. Define a database schema inside the layer
  3. Define another database schema outside the layer
  4. Run nuxt build
  5. Check the contents of .output/server/node_modules/@nuxthub/db/schema.mjs

Expected behavior
The schema.mjs file should contain the schemas from both layers, just like the one outside the .output directory.

Current behavior
The schema.mjs inside .output only contains schemas from a single layer

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions