-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When a Nuxt app uses layers installed via gh: extends (which are resolved into node_modules/.c12/), buildDatabaseSchema fails because the generated hub/db/schema.entry.ts contains absolute-path re-exports pointing to .ts files under node_modules:
export * from '/project/node_modules/.c12/gh_Org_layer_abc123/server/db/schema/users.postgresql.ts'When tsdown processes this entry file, Node's type stripping is invoked on those .ts files, which fails because Node does not support stripping types from files under node_modules.
Steps to reproduce
- Create a Nuxt layer that defines DB schema files in server/db/schema/*.ts
- In a consuming app, extend that layer via gh: syntax:
// nuxt.config.ts
export default defineNuxtConfig({
extends: [
['gh:Org/layer#main', { auth: process.env.GITHUB_TOKEN, install: true }],
],
modules: ['@nuxthub/core'],
hub: { db: 'postgresql' },
})- Run nuxi dev or nuxi build
- See error: Stripping types is currently unsupported for files under node_modules,
for "file:///project/node_modules/.c12/gh_Org_layer_abc123/server/db/schema/example.po
stgresql.ts"
Expected behavior
Schema files from gh: extended layers should work regardless of their resolved location on disk. The schema .ts files from layers under node_modules/.c12/ should be copied to the build directory (outside node_modules) before being passed to tsdown, so that Node's type stripping can process them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working