-
Notifications
You must be signed in to change notification settings - Fork 665
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
Resolve issue with Prisma by providing a way to pass --allow-scripts
#2782
Comments
Deno by default will try to install any missing dependencies when running name: Deploy
on:
push:
branches: [main]
pull_request:
branches: main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: rc
+ - name: Install dependencies
+ run: deno install --allow-scripts=npm:[email protected],npm:@prisma/[email protected],npm:@prisma/[email protected]
- name: Build step
run: "deno task build" # 📝 Update the build command(s) if necessary
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "fresh" # 📝 Update the deploy project name if necessary
entrypoint: "./main.ts" # 📝 Update the entrypoint if necessary
root: "." |
Since Prisma is on 6.0.1 now I added:
before the "Build step" step. That successfully resolved the postinstall issue but lead to the following error:
That error is happening because in following this setup, the standard
That leads to the following error in the "Upload to Deno Deploy" step:
I'm not sure where that error is coming from nor how to debug it. I haven't made any notable changes to the "Upload to Deno Deploy" step:
At first when I submitted this GitHub Issue I was thinking that it might be an issue with Fresh, either 1) because there isn't a way to pass Anyway, I'm not sure if my current issue is really related to Fresh. It probably isn't. And so I think it'd be understandable to want to close this issue. On the other hand, Prisma is a popular ORM, I expect that people trying to use Prisma with Fresh will run into issues similar to the ones I'm running into, and that this conversation will help those people. For that reason I feel like it'd be worth keeping this issue open and working to resolve it, but I don't feel strongly. |
I'm trying to get Prisma set up in my new Fresh project. I imitated this repo and it works locally, but I run into issues when deploying to Deno Deploy. More specifically, when
deno task build
runs, this warning shows up in my GitHub Action logs:followed by this error:
This makes sense. The
@prisma/client
NPM package has apostinstall
hook that generates the Prisma client. Such hooks won't run withdeno install
unless you have the--allow-scripts
flag. I can't tell wheredeno install
is actually being triggered, but given the log output, it appears that the--allow-scripts
flag isn't being used.To see where
deno install
might be being triggered, my reasoning is as follows. The issue comes during the "Build step" step of the "Deploy" job, which runsdeno task build
. Fromdeno.json
we can see thatdeno task build
executesdeno run -A dev.ts build
. I didn't touchdev.ts
. Here's what it looks like:From here I'm not sure what's going on, nor how I can find
deno install
and add--allow-scripts
. I can see thatdev
is being called but I can't find any docs fordev
. I tried digging intomain.ts
andconfig
, but couldn't really figure out what's going on there or whether there's any tweaks I can make in either of those places to resolve this issue.To support Prisma and other NPM packages with postinstall hooks, I think Fresh should provide and/or document a way to allow such scripts to run.
The text was updated successfully, but these errors were encountered: