Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Prisma prismaSchemaFolder extension causes EISDIR error then fail deploy #1635

Open
whchi opened this issue Jan 24, 2025 · 1 comment
Open

Comments

@whchi
Copy link

whchi commented Jan 24, 2025

Provide environment information

I encountered a similar error in #1565, attempted the proposed solution, but it did not work.
"@trigger.dev/sdk": "3.3.11"
"@prisma/client": "6.2.0"

Describe the bug

error message:

✘ [ERROR] Failed to apply extension PrismaExtension onBuildComplete SystemError [ERR_FS_EISDIR]: Path is a directory: cp returned EISDIR (/path/to/libs/prisma-schema/src/prisma/schema is a directory (not copied)) /path/to/libs/prisma-schema/src/prisma/schema

 {
    code: 'ERR_FS_EISDIR',
    info: {
      message:
  '/path/to/libs/prisma-schema/src/prisma/schema is a
  directory (not copied)',
      path: '/path/to/libs/prisma-schema/src/prisma/schema',
      syscall: 'cp',
      errno: 21,
      code: 'EISDIR'
    },
    errno: [Getter/Setter: 21],
    syscall: [Getter/Setter: 'cp'],
    path: [Getter/Setter:
  '/path/to/libs/prisma-schema/src/prisma/schema']
  }

Reproduction repo

not able to provide

To reproduce

the following configuration can reproduce same issue

  • schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["strictUndefinedChecks", "prismaSchemaFolder", "relationJoins"]
  binaryTargets   = ["native", "debian-openssl-3.0.x"]
}
  • package.json
...
  "prisma": {
    "schema": "./libs/prisma-schema/src/prisma/schema"
  }
...
  • trigger.config.ts
defineConfig({
  build: {
    extensions: [
       additionalFiles({
          files: [
            './libs/prisma-schema/src/prisma/schema/nas.prisma',
            './libs/prisma-schema/src/prisma/schema/schema.prisma',
          ],
      }),
      additionalPackages({
        packages: ["@prisma/[email protected]"]
      }),
      prismaExtension({
        schema: './libs/prisma-schema/src/prisma/schema',
        version: '6.2.0',
        migrate: false,
      }),
})

Additional information

No response

@Hexatare
Copy link

Hexatare commented Jan 30, 2025

I was able to fix the issue by just pointing to my schema.prisma file (the main file containing the generator and datasource), like this:

    build: {
        extensions: [
            prismaExtension({
                schema: "../../clients/database/prisma/schema/schema.prisma",
            }),
        ],
    },

But I do agree that the documentation is not very clear and this could be confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants