Redwood v7.0.0 Upgrade Guide

When running yarn I get this message:

➤ YN0060: │ @redwoodjs/graphql-server is listed by your project with version 7.0.0, which doesn't satisfy what @redwoodjs/api-server (pccff9) requests (6.0.7).

Is this correct? I checked yarn.lock and it indeed lists "@redwoodjs/graphql-server": 6.0.7 in peerDependencies. I think it should be 7.0.0

1 Like

Hey @higajooj thanks! That’s a bug. It should be 7.0.0 indeed. looks like we’ve got our first patch.

1 Like

Just got a patch out:

Let me know if it works for you @higajooj, thanks again!

1 Like

Working ok so far, thanks!

1 Like

Can anybody reproduce this, running yarn redwood setup monitoring sentry

❯ yarn redwood setup monitoring sentry
✔ Adding required api packages...
✔ Adding required web packages...
✔ Adding SENTRY_DSN var to .env...
✖ ENOENT: no such file or directory, open '/home/username/dev/project_name/node_modules/@redwoodjs/cli/dist/command
  s/setup/monitoring/sentry/templates/sentryApi.ts.template'
◼ Implementing the Envelop plugin
◼ Replacing Redwood's Error boundary
◼ One more thing...
ENOENT: no such file or directory, open '/home/username/dev/project_name/node_modules/@redwoodjs/cli/dist/commands/setup/monitoring/sentry/templates/sentryApi.ts.template'

Thanks for this release, im particarly excited about the new server.js stuff.

I am struggling with the upgrade. After running yarn rw upgrade it fails, stating to run yarn install and then yarn purge.

✔ Checking latest version
✔ Updating your Redwood version
  ✔ Updating <cwd>/package.json
  ✔ Updating <cwd>/api/package.json
  ✔ Updating <cwd>/app/web/package.json
✖ Could not finish installation. Please run `yarn install` and then `yarn dedupe`, before continuing
◼ Refreshing the Prisma client
◼ De-duplicating dependencies
◼ One more thing..

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error: Could not finish installation. Please run `yarn install` and then `yarn dedupe`, before continuing
    at yarnInstall (<cwd>/node_modules/@redwoodjs/cli/dist/commands/upgrade.js:174:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _Task.run (<cwd>/node_modules/listr2/dist/index.cjs:2049:11)

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Need help?
 - Not sure about something or need advice? Reach out on our Forum (​https://community.redwoodjs.com/​)
 - Think you've found a bug? Open an issue on our GitHub (​https://github.com/redwoodjs/redwood​)
 - Here's your unique error reference to quote: '3bce1850-24b7-4819-b377-ca3fb76a89b0'

However when running yarn install I get:

➤ YN0082: │ @graphql-codegen/visitor-plugin-common@npm:5.0.0: No candidates found

I tried rm -rf node_modules and try it again, but no luck. Anyone else faced with this?

  • node v20.9.0
  • yarn 4.0.2

Hey @LeeGeorge, maybe you just caught NPM at a bad time? It looks like that package was published only a day ago and so far has zero downloads (as far as NPM stats go):

Maybe you caught the registry at a bad time, when the package that was requesting v5.0.0 was published but not v5.0.0? We had a few issues like this with some of these packages framework-side for a while.

I’d say try again and if it persists, if you could share with me via DM here on the forums your project’s package.jsons or yarn.lock I could go about investigating more.

1 Like

Hey @razzeee yeah I can reproduce that—thanks for reporting will look into it!

Since upgrading I am seeing two issues. One is my storybook.preview.js seems to not be picked up any longer, did not see anything mentioned in the release notes about a change there. Second issue launching the studio gives an error because the command is escaped incorrectly for directories with a space. Snippet from the output:
escapedCommand: 'npx prisma migrate deploy --schema "/Users/justme/dirwitha" and "space/Code/myproj_web/node_modules/@redwoodjs/studio/api/db/schema.prisma"'

1 Like

Hey @dennis1600, I’ll look into the storybook.preview.js issue. Mind sharing that file if possible or at least the gist of what you’re doing there?

And for the issue with Studio, could you make an issue on the repo here? Thanks!

It is just the setup for storybook-tailwind-dark-mode. I will create an issue for the studio. Appreciate the help!

const preview = {
  globalTypes: {
    darkMode: {
      defaultValue: true,
    },
    className: {
      defaultValue: 'dark',
    },
  },
}

export default preview

1 Like

This should be resolved in v7.0.2:

Yeah, I ran into that too.
My workaround was to go into my RW project, and run yarn add @graphql-codegen/visitor-plugin-common. After that I could successfully run yarn install and got all of RW and all its dependencies installed

1 Like

I guess us already having a sentry integration and wanting to change to the redwood one, causes this error?

❯ yarn rw upgrade
✔ Checking latest version
✔ Updating your Redwood version
  ✔ Updating /home/klampe/dev/slashskills/package.json
  ✔ Updating /home/klampe/dev/slashskills/api/package.json
  ✔ Updating /home/klampe/dev/slashskills/web/package.json
✔ Running yarn install
✔ Refreshing the Prisma client
✔ De-duplicating dependencies
✔ One more thing...
  🎉 Your project has been upgraded to RedwoodJS 7.0.2!
  Please review the release notes for any manual steps:
  ❖ Redwood community discussion
  ❖ GitHub Release notes
❯ git rebase origin/develop -i
Successfully rebased and updated refs/heads/redwood-7-rc.
❯ yarn redwood setup monitoring sentry
✔ Adding required api packages...
✔ Adding required web packages...
✔ Adding SENTRY_DSN var to .env...
✔ Setting up Sentry on the API and web sides
✔ Implementing the Envelop plugin
✖ Unterminated regular expression. (49:3)
  47 |
  48 | export default App
  > 49 | </Sentry.ErrorBoundary>
  |   ^
◼ One more thing...
Unterminated regular expression. (49:3)
  47 |
  48 | export default App
> 49 | </Sentry.ErrorBoundary>
     |   ^

I also wonder, if you have thought of a way to prevent local dev machines from sending data to sentry - as we had to setup an env for that previously. Or do we have complete access to the init statements?

Previously we had:

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.ENVIRONMENT,
  tracesSampleRate: 0.5,
  enabled: process.env.SENTRY_ENABLED === 'true',
  release: 'api@' + process.env.CI_COMMIT_SHA,
})
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  environment: process.env.ENVIRONMENT,
  integrations: [Sentry.browserTracingIntegration()],
  tracesSampleRate: 0.5,
  enabled: process.env.SENTRY_ENABLED === 'true',
  release: 'web@' + process.env.CI_COMMIT_SHA,
})

Thanks, this worked for me.

Heads up that that workaround may work but it’s likely to introduce problems in the future if your version of @graphql-codegen/visitor-plugin-common gets out of sync with the one that one of our dependencies is requesting. I’d at least be sure not to pin the version of @graphql-codegen/visitor-plugin-common that you’re installing in your project so that yarn has the chance to deduplicate if it can.

Thanks for the heads up! I have set it as follows

  "dependencies": {
    "@graphql-codegen/visitor-plugin-common": "*"
  }

…for now. Will remove it eventually and see if deps resolve.

1 Like

Nice that looks perfect!

1 Like

@dennis1600 heads up that I was able to somewhat reproduce the Storybook issue you’re having (at least I’m having trouble getting it to work out of the box). Just to be transparent, this one is lower on my list, so I’m not sure when I’ll get around to looking at a fix—probably not this week. But will keep it in mind if I have more ideas. I know we’re a Storybook version behind or two so it could be fixed in one of those releases. But yeah just wanted to give an update.

Appreciate it! It was strange that it is what stopped working for me. I am not yet convinced that this is even a redwood bug. I am going to look through the storybook docs and see if there is anything I can add to the preview that works and see if perhaps this is isolated to this specific storybook plugin. I will update you here if I find anything.

1 Like