Redwood v0.36 šŸš€

Upgraded my app to 36.2 and it doesnā€™t look like my schemas are being loaded. Itā€™s happening both on my app thatā€™s taking full-advantage of what RW has to offer and on a small test-app, explained below.

I created the test-app (after hawking over my SDLs to make sure it wasnā€™t a typo), hooked it up to my local Postgres container, and added a simple model (AccountConfirmation) with an autogenerated ID. Then I used the RW CLI to generate an SDL, service, cell and page. The same error I was getting on my app I got again: Cannot query field "accountConfirmations" on type "Query". (When trying to use a mutation, itā€™s: Schema is not configured for mutations.)

Taking a look at .redwood/schema.graphql, the query is being generated:

type Query {
  accountConfirmations: [AccountConfirmation!]!
  redwood: Redwood
}

On the playground, the accountConfirmations query is missing, however:

image

This is happening both with Apollo and in my app, which uses Envelope+Helix.

Traveling back to a commit I made right before updating, everything works as expected. The only changes I made in-between were to upgrade and a few inconsequential, QoL improvements.

I removed all comments from my SDL, no joy. Deleting and re-generating/installing node_modules, .redwood, and yarn.lock with all dependencies updated similarly, brought very little joy.

Just updated from 0.33 to latest (one release at a time). Now Iā€™m getting a bunch of errors, and Iā€™m not even sure where to start debugging :frowning:

Itā€™s real basic stuff thatā€™s not working, like Unknown type "Int". and cannot query field "fieldName" on type "Query".

image

Anyone have any pointers on where to start digging? Thanks!

  • Did you have any comments/descriptions in sdl? graphtools/merge introduced a bug with comments
  • Do you see the same if you use the graphql-server package?

We are having the same error here at SportOffice, but maybe we can add different infos.

I upgraded main to v0.36.2, I had to do a lot of fixes on the web side due to our code using non RW components for forms, but eventually this did pass.

My coworker then created his branch and initiated his work, but he was still in v0.35.x. We then updated his branch with main and it crashed on that bug, which manifests as:

  • we can find a .redwood/schema.graphql properly built
  • web side is not using it, as in the front app crashes with queries not found in graphql type Query, and Apolloā€™s playground would not load a properly populated schema but instead an empty one - with RW defaults.

We attempted the following without success:

  • cloning a new repo, building types from main and switching to the working branch
  • deleting .redwood and node_modules, running yarn install then yarn rw dev

On my machine we could reproduce the bug, but it got resolved after running yarn install without removing the aforementioned directories.

This is the conf for his machine:

System:
    OS: Windows 10 10.0.19043
  Binaries:
    Node: 14.17.0 - ~\AppData\Local\Temp\yarn--1630412190286-0.7090112234968149\node.CMD
    Yarn: 1.22.10 - ~\AppData\Local\Temp\yarn--1630412190286-0.7090112234968149\yarn.CMD
  Browsers:
    Chrome: 92.0.4515.159
    Edge: Spartan (44.19041.1023.0), Chromium (92.0.902.84)
  npmPackages:
    @redwoodjs/core: ^0.35.2 => 0.35.2
    @redwoodjs/eslint-config: ^0.34.1 => 0.34.1

This is the conf for my machine:

System:
    OS: Linux 5.11 Ubuntu 21.04 (Hirsute Hippo)
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 14.17.5 - /tmp/yarn--1630413229635-0.37437235949450476/node
    Yarn: 1.22.10 - /tmp/yarn--1630413229635-0.37437235949450476/yarn
  Browsers:
    Chrome: 92.0.4515.159
    Firefox: 91.0.2
  npmPackages:
    @redwoodjs/core: ^0.36.2 => 0.36.2 
    @redwoodjs/eslint-config: ^0.36.2 => 0.36.2 

The only difference we could find so far is that itā€™s running on linux machines but not on windows. Our production and preproduction environments, both on netlify, didnā€™t have the issue.
We didnā€™t touch our sdl to see if it could fix the problem, and we have a couple of comments in them.

No. I saw that comment previously in the thread, so I made sure to look for those. I did have some // style comments, but I removed those too.

Iā€™m already using graphql-server. Havenā€™t experimented with envelop yet

The Windows/Linux duality would line up with what Iā€™m experiencing: Iā€™m on Windows as well.

@realStandal @noire.munich I think I have a workaround for our errors

The special glob imports in graphql.js werenā€™t working for me. So I had to do the magic myself instead

// import schemas from 'src/graphql/*/*.{js,ts}'
// import services from 'src/services/**/*.{js,ts}'

import categories from 'src/graphql/categories.sdl'
import simpleProducts from 'src/graphql/simpleProducts.sdl'
import snipcart from 'src/graphql/snipcart.sdl'

import categoriesService from 'src/services/categories/categories'
import simpleProductsService from 'src/services/simpleProducts/simpleProducts'
import snipcartService from 'src/services/snipcart/snipcart'

const schemas = {
  'categories.sdl': categories,
  'simpleProducts.sdl': simpleProducts,
  'snipcart.sdl': snipcart,
}

const services = {
  categories_categories: categoriesService,
  simpleProducts_simpleProducts: simpleProductsService,
  snipcart_snipcart: snipcartService,
}
2 Likes

Hey! Great stuff, thank you; works fine!

Hmm - this is strange. We are all having different errors but related to imports.

@Tobbe Are you running on windows? and also, did you upgrade from v0.35 to v0.36, or from a < v0.35?

Yes, Windows. Updated from 0.33 step by step up to 0.36

I have a PR up with a fix babel-plugin-redwood-import-dir: Fix regex and Windows paths by Tobbe Ā· Pull Request #3311 Ā· redwoodjs/redwood (github.com)

2 Likes

Ah. Iā€™m using windows but with WSL. So donā€™t think my errors are related.

Just upgraded the Open Sauced Admin Dashboard from v0.24 to v0.36.2, with the exception of some PgBouncer issues it seemed to work without any other major errors.

1 Like

Patch release, mainly resolving Windows issues has been released!

2 Likes

v0.36.4

Patch Release

This release contains fixes for Prisma:


View complete Release Notes on GitHub

Thank you for this!

FYI: After upgrading I ran into a useRegister error that crashed a page that had form fields in it (e.g. <EmailField /> in my case, though I think the issue was more wide-spread than that specific field) and it seemed to get resolved by removing my explicit installation of react-hook-form from my project. No biggie at all, but this is something to look into if anyone else runs into a similar error while upgrading.

1 Like