Redwood v7.0.0 Upgrade Guide

I’m currently upgrading from 6.X to 7.1.3 and am running into an issue with running the studio in a github action (we run the studio for our UI tests in CI)

Basically, when trying to run the studio in CI, it gives the following error:

PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime “debian-openssl-1.1.x”.

This happened because Prisma Client was generated for “darwin-arm64”, but the actual deployment required “debian-openssl-1.1.x”.

For context, I am doing local development on a Mac and this is only a problem for running the studio – not running the actual app. It suggests adding “debian-openssl-1.1.x” to the binaryTargets in schema.prisma but I don’t have access to this because it’s in a dependency’s prisma.schema (or at least, I think I don’t)

Has anyone run into this? My question is obviously how to fix this. But more specifically, I’m wondering at what point the prisma client is generated for the studio? It strikes me that the engine could be hard coded somewhere that has been committed but I’ve yet to be able to find it.

Thanks for the help in advance!

1 Like

Yeah I’ve had this same issue and I think a few others have mentioned something similar above. From my research, it seems like the fix is in this PR of @redwoodjs/studio, which has already been merged to the main branch. The problem is that there has not been a new tag/build of that package that includes that change. @Tobbe mentioned above that he was going to work on getting that done, but I haven’t seen any new tags come through.

2 Likes

You will find the engine in /node_modules/@redwoodjs/studio/api/db/client/

To get rw studio working locally on Mac,
Redwood version 7.3.0 (but these steps worked on RW 7.1.3)

  1. I delete the engine at /node_modules/@redwoodjs/studio/api/db/client/

  2. I then copy in the correct engine (for me)
    from
    /node_modules/.prisma/client/libquery_engine-darwin.dylib.node
    to
    /node_modules/@redwoodjs/studio/api/db/client/

  3. At this point yarn rw studio works for me.

  4. But… i still do not get the graphs

  5. I had to install the open telemetyry
    yarn rw exp setup-opentelemetry

6 And…make a fix suggested elsewhere to
node_modules/@redwoodjs/studio/api/dist/functions/otel-trace/otel-trace.js
changing two lines
from
startTimeNano: convertLongToBigInt(span.startTimeUnixNano),
endTimeNano: convertLongToBigInt(span.endTimeUnixNano),
to
startTimeNano: span.startTimeUnixNano,
endTimeNano: span.endTimeUnixNano,

  1. Now starting the dev server (yarn rw dev) then studio (yarn rw studio) works for me.
2 Likes

Hey all :wave:

We just released version 11.4.0 of studio. This contains some important bug fixes which should address the problems discussed here. If you could try it out and confirm everything now works that would be awesome!

1 Like

Hi there,

Now that it seems like the studio issue maybe worked out, I gave upgrading another go and am running into an issue with global context. I am using supabase auth and my context is empty on any graphql call (and I am definitely logged in, currentUser query returns properly). Is there anything that I need to do to populate the context object?

For context, when I tried upgrading previously, this was not an issue (7.1.2) but on 7.4.3 this started happening.