@dmasters19 that’s an odd one, I’ll try to reproduce on that version, but if you want to continue upgrading in the meantime all you have to do is update the version of the @redwoodjs/* packages in all the package.jsons (in the root, the api dir, and the web dir) to 5.1.2 (the latest version at this time) and then run yarn install.
@dom Thank you, I upgraded all my redwood packages as well as my react packages and my application starts succesfully.
I am now getting this error when trying to start storybook:
ModuleParseError: Module parse failed: parser.destructuringAssignmentPropertiesFor is not a function.
File was processed with these loaders: * …/node_modules/@redwoodjs/core/node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js * …/node_modules/@redwoodjs/core/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
TypeError: parser.destructuringAssignmentPropertiesFor is not a function
hi @dmasters19, if you don’t mind sharing the output from yarn why webpack, that might prove useful in helping figure out what is going on. also if you have webpack explicitly defined somewhere in your package.json will you please try something like "webpack": "^5.82.0"?. I am basing this logic off of quick research into the error I did.
Mainly, the reproduction section—is there a story file you can isolate the bug to? Is this a stack trace in the browser or is it in the CLI when you run yarn rw sb? The more details the better
I did not upgrade to 5 till now as we do some fetches to our CMS directly and all the tests on web including a fetch are throwing this error. The error leads to a broken build pipeline.
PASS web web/src/components/Overview/OverviewTopHint/OverviewTopHint.test.tsx
//node_modules/jsdom/lib/jsdom/browser/Window.js:376
return idlUtils.wrapperForImpl(idlUtils.implForWrapper(window._document)._location);
^
TypeError: Cannot read properties of null (reading '_location')
at Window.get location [as location] (//node_modules/jsdom/lib/jsdom/browser/Window.js:376:79)
at FetchInterceptor.<anonymous> (//node_modules/@mswjs/interceptors/src/interceptors/fetch/index.ts:52:9)
at step (//node_modules/@mswjs/interceptors/lib/interceptors/fetch/index.js:59:23)
at Object.next (//node_modules/@mswjs/interceptors/lib/interceptors/fetch/index.js:40:53)
at fulfilled (//node_modules/@mswjs/interceptors/lib/interceptors/fetch/index.js:31:58)
Node.js v18.16.0
Thanks for reporting @tilmannb, I’ll try a few things. Could you provide the contents of the OverviewTopHint component too so I could debug locally? (You can also DM me if you don’t want to share here)
@tilmannb the render function returns an object with an unmount property that you can destructure and try calling. Here’s the react testing library docs on it: API | Testing Library. And here’s an example:
import { render } from '@redwoodjs/testing/web'
import OverviewTopHint from './OverviewTopHint'
describe('OverviewTopHint', () => {
// skip for now as the fetch throwns an error
it.skip('renders successfully', () => {
expect(() => {
- render(<OverviewTopHint />)
+ const { unmount} = render(<OverviewTopHint />)
+ unmount()
}).not.toThrow()
})
})