Redwood v6.0.0 Upgrade Guide

Hi. Do you see any difference if you also include:

credentials: true

As an option ?

no difference

I can reproduce this, thanks!

Update: @mat I think I’ve figured this one out and it seems to be a regression in @what-wg/node-fetch: CORS Preflight requests aren't resolving · Issue #703 · ardatan/whatwg-node · GitHub.

@fmiranda It’s not possible to directly create a v6 RC project. But you can create a canary project. It’s v6 + initial work on v6.1 and v7. It’s more unstable, but works most of the time

Just run npx create-redwood-app@canary ~/tmp/rw-npx-canary

Or, to bypass all prompts and go with the defaults (TS project with git initialized)

npx -y create-redwood-app@canary -y ~/tmp/rw-npx-canary

@mat things are work locally for me now that there’s a new version of @whatwg-node/node-fetch (v0.4.11) out. You may have to redo your yarn.lock file to get it because none of Redwood’s packages depend on it directly.

In your project, if you run yarn why @whatwg-node/node-fetch, you should get ~three versions:

├─ @whatwg-node/fetch@npm:0.8.8
│  └─ @whatwg-node/node-fetch@npm:0.3.6 (via npm:^0.3.6)
│
├─ @whatwg-node/fetch@npm:0.9.7
│  └─ @whatwg-node/node-fetch@npm:0.4.11 (via npm:^0.4.6)
│
└─ @whatwg-node/fetch@npm:0.9.9
   └─ @whatwg-node/node-fetch@npm:0.4.11 (via npm:^0.4.8)

If you don’t see those two 0.4.11s, could you rebuild your lock file (i.e. delete it and yarn install) and see if that fixes things for you?

Hi guys, thanks for the answers! I think I’m going to wait for the official release of 6.0. I’m curious about 6.0 but the last stable release works perfectly fine.
Thanks!

@razzeee, @danny shared this with me—we do have new recommendations for custom fonts with Vite that should make them play well with Storybook:

Thanks for reporting this, the latest RC has a fix for this:

1 Like

Works perfectly now, thanks!

Context seems fin now, but I can’t get the font to work.

Presumably the relative path doesn’t work, not sure why. If I set it with public I can see the browser trying to actually access it in a folder named public.

1 Like

Just did the upgrade from v4 to v5 and now looking at going v5 to v6.

Hit a snag going from v5 to v6 where it looks like I either deleted out the tailwind config or it got reset on the v4 to v5 or v5 to v6 jump.
Either way, now that there are some .jsx extensions (as per moving from v5 to v6), I had to update the tailwind.config.css to include those in case anyone else hit this snag:

Before:

After:

tailwind.config.css before:

module.exports = {
  content: ['./src/**/*.{html,js}'],
  theme: {
    extend: {},
  },
  plugins: [],
}

updated to:

module.exports = {
  content: ['./src/*.{js,jsx}', './src/**/*.{js,jsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
}
1 Like

Thanks @QuinnsCode! I’ll see if I can add that step to a codemod; if not I’ll update the guide to include it.

Just ran the upgrade, I am seeing this.

My other models should fail first, any chance Subscription would be a reserved name?

With v6, real-time adds GraphQL subscription support and as it tries to validate your type needs a directive.

We should test if other GraphQL operations would fail similarly if you defined a mode called Query or Mutation or Client for example.

Could you write up an issue for this as will either want to handle better, give a friendlier message and or document reserved types.

1 Like

I’m getting an error with storybook and TypeScript… even if I start a new app from scratch:

$ node --version
v18.16.0
$ yarn --version
1.22.19
$ yarn create redwood-app --typescript ./testrw
$ cd testrw
$ yarn rw tc
... no errors
$ yarn rw g page MyTest
$ yarn rw tc
src/pages/MyTestPage/MyTestPage.stories.tsx:1:37 - error TS2307: Cannot find module '@storybook/react' or its corresponding type declarations.

1 import type { Meta, StoryObj } from '@storybook/react'
                                      ~~~~~~~~~~~~~~~~~~


Found 1 error in src/pages/MyTestPage/MyTestPage.stories.tsx:1

EDIT: fixed via:

$ yarn workspace web add -D @storybook/react
$ yarn rw tc

Seems like a dependency is missing somewhere in the default install…?

1 Like

Hey @sean-ac sorry about that! We recently changed the CLI to lazy install storybook so that it’s not installed by default but when you first run a storybook command it is installed automatically for you. Looks like we might have missed this issue. I’ll take a look today, thanks!

2 Likes

I noticed people are saying this all works fine now but we are running 6.0.2 and still seeing this as broken.

I am also seeing this around services named Subscription. Is there a workaround? All directives appear to be correctly implemented.

Hi. An issue [Bug?]: v6 doesn't allow for a Subscription sdl type. · Issue #8988 · redwoodjs/redwood · GitHub is written up for this and I’ll have a look.

I think any model/type name Query or Mutation in your schema might fail, too.

Hey @jonoc330, could you share a little more information about the issue that still persists? Do all your API tests that deal with context fail or only some? Would you be able to share a small example of a failure?

Prior to the changes we made in v6 the context was not isolated between tests but now every new test has a clean context. This is more in keeping with a real redwood request which itself has an isolated context. This does however mean that if you want some value in the context across various tests you’ll have to update the initial context every time. This cannot be done in a beforeAll.