Just a quick update on my findings. I am not able to get global decorators or anything to work that would be picked up from the preview file. I tried the example from redwood, the example from storybook and several others and nothing seems to work.
"resource": "../web/tsconfig.json",
"owner": "typescript",
"severity": 8,
"message": "Cannot find type definition file for 'jest-dom'.\n The file is in the program because:\n Entry point of type library 'jest-dom' specified in compilerOptions",}]
Have a Cannot find typed definition for jest-dom error
Wanted to give the core team a big shoutout for this upgrade guide. Everything took < 10 mins, without any hiccups, from local to prod (on vercel). Great job!
Thank you for dropping the note of praise. Although I had nothing to do with any of the updates, it is very nice to hear this. I am glad it worked out so well.
Thanks @evansibok! There’s a bug right now with the current version of studio which is the issue you are seeing. I’ll update here again once we have a patched version out that fixes the hardcoded platform support. Hopefully we’ll get this out in the next day or so.
The prisma studio is a feature from prisma that lets you browse the structure and data that’s inside your database, as well as letting you edit it manually from the browser. Redwoods own studio doesn’t have this feature but has a whole bunch of others. Including mailer integration, DB and graphql schema visualisation, and opentelemetry browsing.
I’m trying to use the new Prisma studio, and while I can see my graphql schema and it shows my development server is connected, I get an error any time I try to run a GraphQL query in the GraphQL playground. Every query (even for the redwood version) gives a FST_REPLY_FROM_SERVICE_UNAVAILABLE. The studio logs are showing Error: getaddrinfo ENOTFOUND undefined\n at GetAddrInfoReqWrap.onlookupall The dev server logs don’t show anything, so it appears the request isn’t making it out of the studio. I’m running 7.0.2, with a postgres database, and using netlify for authentication. Any idea what I’m doing wrong or may have misconfigured? I’ve tried @skipAuth too, so it doesn’t seem to be auth related - it can’t even query the redwoodjs version.
If I go to localhost:8911/graphql, I can query my endpoint just fine. I don’t see anything in my dev server logs either.
Is anyone else seeing an issue with requireAuth() not receiving the context after upgrading? I’m running on Netlify (upgraded to node v20).
export const requireAuth = ({ roles } = {}) => {
console.log('requireAuth', roles, context)
if (!isAuthenticated()) {
throw new AuthenticationError("You don't have permission to do that.")
}
if (roles && !hasRole(roles)) {
throw new ForbiddenError("You don't have access to do that.")
}
}
My console.log() is returning:
requireAuth undefined {}
The site works fine locally. Also, I am using Clerk for auth.
Seems to be specifically here that’s not receiving the context variable:
I’m having the same issue with Azure Active Directory authentication.
context.currentUser returns undefined, but I can console.log(context.currentUser) without issue. It shows as a type of object with 5 keys, but when accessing the keys via context[‘key’] or context.key it returns undefined. All of the user data is in the context when logged to console, I snipped out pieces in the log below to shorten for this post.
@Josh-Walker-GM fwiw, this still isn’t working for me on 7.0.6. I just made a vanilla project, and I get the same error. Also, it seems on 7.0.6, the yarn rw studio command seems to fail now due to trying to install in a default workspace:
(base) martin@Martins-MBP studio-test % yarn rw studio
yarn run v1.22.19
$ /Users/martin/Code/studio-test/node_modules/.bin/rw studio
The studio package is not installed, installing it for you, this may take a moment...
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Cannot start the development studio
Error: Command failed with exit code 1: yarn add -D @redwoodjs/studio@11
at makeError (/Users/martin/Code/studio-test/node_modules/execa/lib/error.js:60:11)
at handlePromise (/Users/martin/Code/studio-test/node_modules/execa/index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async installModule (/Users/martin/Code/studio-test/node_modules/@redwoodjs/cli/dist/lib/packages.js:37:5)
at async handler (/Users/martin/Code/studio-test/node_modules/@redwoodjs/cli/dist/commands/studioHandler.js:23:7)
at async runYargs (/Users/martin/Code/studio-test/node_modules/@redwoodjs/cli/dist/index.js:191:3)
at async /Users/martin/Code/studio-test/node_modules/@redwoodjs/cli/dist/index.js:142:7
at async main (/Users/martin/Code/studio-test/node_modules/@redwoodjs/cli/dist/index.js:123:3) {
shortMessage: 'Command failed with exit code 1: yarn add -D @redwoodjs/studio@11',
command: 'yarn add -D @redwoodjs/studio@11',
escapedCommand: 'yarn add -D "@redwoodjs/studio@11"',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(base) martin@Martins-MBP studio-test % yarn add -D "@redwoodjs/studio@11"
(base) martin@Martins-MBP studio-test % yarn rw studio
yarn run v1.22.19
$ /Users/martin/Code/studio-test/node_modules/.bin/rw studio
Cannot start the development studio
Error: Cannot find module '@redwoodjs/realtime'
Require stack:
- /Users/martin/Code/studio-test/node_modules/@redwoodjs/studio/api/dist/util/connectionWatching.js
- /Users/martin/Code/studio-test/node_modules/@redwoodjs/studio/api/dist/server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/Users/martin/Code/studio-test/node_modules/@redwoodjs/studio/api/dist/util/connectionWatching.js:35:23)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/martin/Code/studio-test/node_modules/@redwoodjs/studio/api/dist/util/connectionWatching.js',
'/Users/martin/Code/studio-test/node_modules/@redwoodjs/studio/api/dist/server.js'
]
}
When I manually installed the dependencies, it did start though, but the Fastify FST_REPLY_FROM_SERVICE_UNAVAILABLE error remains.