Skip to content

Build fails with TypedSQL enabled due to directory layout #1325

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

Closed
gorbak25 opened this issue Sep 19, 2024 · 2 comments
Closed

Build fails with TypedSQL enabled due to directory layout #1325

gorbak25 opened this issue Sep 19, 2024 · 2 comments

Comments

@gorbak25
Copy link

const prismaDir = dirname(schemaDir);

The code in the CLI expects the directory layout to be:

<project_root>/sql - sql files for TypedSQL
<project_root>/<prisma_dir> - prisma directory
<project_root>/<prisma_dir>/<schema_name> - Prisma schema

While in reality the directory layout is:

<project_root>/<prisma_dir> - prisma directory
<project_root>/<prisma_dir>/sql - sql files for TypedSQL
<project_root>/<prisma_dir>/<schema_name> - Prisma schema

This results in builds failing:

✘ [ERROR] Failed to apply extension PrismaExtension onBuildComplete Error: ENOENT: no such file or directory, scandir '/workspaces/mapanfz/sql'

      at async readdir (node:internal/fs/promises:950:18)
      at async PrismaExtension.onBuildComplete
  (/workspaces/mapanfz/node_modules/@trigger.dev/build/dist/commonjs/extensions/prisma.js:75:30)
      at async notifyExtensionOnBuildComplete
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/build/extensions.js:16:17)
      at async buildWorker
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/build/buildWorker.js:70:21)
      at async _deployCommand
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/commands/deploy.js:120:27)
      at async
  file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/commands/deploy.js:77:16
      at async
  file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/cli/common.js:54:28
      at async wrapCommandAction
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/cli/common.js:40:12)
      at async deployCommand
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/commands/deploy.js:76:12)
      at async
  file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/commands/deploy.js:71:13
      at async handleTelemetry
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/cli/common.js:30:9)
      at async Command.<anonymous>
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/commands/deploy.js:69:9)
      at async Command.parseAsync
  (/home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/commander/lib/command.js:935:5)
      at async main
  (file:///home/vscode/.npm/_npx/f51a09bd0abf5f10/node_modules/trigger.dev/dist/esm/index.js:5:5) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'scandir',
    path: '/workspaces/mapanfz/sql'
  }

As a workaround I've added /sql to my gitignore and before running the deploy i just copy over the sql folder from the prisma directory.

@gorbak25 gorbak25 changed the title Build fails with TypedSQL enabled Build fails with TypedSQL enabled due to directory layout Sep 19, 2024
@triggerdotdev triggerdotdev deleted a comment from Kami-prog Sep 19, 2024
@triggerdotdev triggerdotdev deleted a comment from gorbak25 Sep 19, 2024
@nicktrn
Copy link
Collaborator

nicktrn commented Sep 19, 2024

Reported and deleted a potential malware link. Sorry, had to delete your reply as well as it quoted the link and would have still been accessible via edit history.

@ericallam is probably best suited to look into your issue. Thanks for reporting it 🙏

@ericallam
Copy link
Member

Thanks for the report, I'll look into this 👍

ericallam added a commit that referenced this issue Sep 19, 2024
samejr added a commit that referenced this issue Sep 19, 2024
commit 64862db
Author: Niels <info@flydev.nl>
Date:   Thu Sep 19 16:25:17 2024 +0200

    Update dotEnv.ts to ignore OTEL_EXPORTER_OTLP_ENDPOINT as well (#1307)

    * Update dotEnv.ts

    * Create four-buttons-run.md

    ---------

    Co-authored-by: Eric Allam <eallam@icloud.com>

commit c65d482
Author: Thibaut Cuchet <thibautcuchet@gmail.com>
Date:   Thu Sep 19 16:22:57 2024 +0200

    Feat: Extension puppeteer (#1323)

    * feat: add puppeteer extension

    * chore: update package and config

    * feat: add puppeteer task

    * Create little-donkeys-protect.md

    ---------

    Co-authored-by: Eric Allam <eallam@icloud.com>

commit b4be736
Author: Eric Allam <eallam@icloud.com>
Date:   Thu Sep 19 15:21:03 2024 +0100

    prismaExtension fixes for #1325 and #1327
samejr added a commit that referenced this issue Sep 19, 2024
* Added pdf-to-image example

* Copy tweak

* Squashed commit of the following:

commit 64862db
Author: Niels <info@flydev.nl>
Date:   Thu Sep 19 16:25:17 2024 +0200

    Update dotEnv.ts to ignore OTEL_EXPORTER_OTLP_ENDPOINT as well (#1307)

    * Update dotEnv.ts

    * Create four-buttons-run.md

    ---------

    Co-authored-by: Eric Allam <eallam@icloud.com>

commit c65d482
Author: Thibaut Cuchet <thibautcuchet@gmail.com>
Date:   Thu Sep 19 16:22:57 2024 +0200

    Feat: Extension puppeteer (#1323)

    * feat: add puppeteer extension

    * chore: update package and config

    * feat: add puppeteer task

    * Create little-donkeys-protect.md

    ---------

    Co-authored-by: Eric Allam <eallam@icloud.com>

commit b4be736
Author: Eric Allam <eallam@icloud.com>
Date:   Thu Sep 19 15:21:03 2024 +0100

    prismaExtension fixes for #1325 and #1327

* Copy tweak
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

3 participants