I’m trying to upgrade from 5.0 to 5.1 or 5.2 but after upgrading I found the following error and I don’t have idea how to fix it.
OS: Ubuntu 23.04
web | ERROR in ../node_modules/@redwoodjs/web/dist/entry/index.js 5:14-41
web | Module not found: Error: Can't resolve 'react-dom/client' in '/home/fernando/git/next/node_modules/@redwoodjs/web/dist/entry'
web | ERROR in Template execution failed: ReferenceError: prerenderPlaceholder is not defined
web | ERROR in ReferenceError: prerenderPlaceholder is not defined
web | - index.html:14
web | /home/fernando/git/next/web/src/index.html:14:11
web | - index.html:17 __webpack_modules__.../node_modules/html-webpack-plugin/lib/lo ader.js!./src/index.html.module.exports
web | /home/fernando/git/next/web/src/index.html:17:3
web | - index.js:450
web | [next]/[html-webpack-plugin]/index.js:450:16
web | - async Promise.all
web | 1 error has detailed information that is not shown.
web | Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
web | webpack 5.83.1 compiled with 3 errors in 8906 ms
Thanks in advance
Ok, finally I found the issue, my file
web/src/index.html included the tag
<%= prerenderPlaceholder %>:
<div id="redwood-app" class="h-full">
<!-- Please keep the line below for prerender support. -->
<%= prerenderPlaceholder %>
After removing this tag, everything works as expected. Not sure why the upgrade command did not remove it.
Correct. For future reference, each release typically has release notes and an upgrade guide published in announcements and in GitHub.
See Redwood v5.0.0 Upgrade Guide
Often there are codemods that will help upgrade existing projects.
@dthyresson Even with the upgrade guide, it was nice to be able to search for this specific error and find this fix. Even though the fix is noted as the very top of the upgrade guide as one of the main things we would need to do. Going to the upgrade guide was not the first thing I did! I ran
yarn rw upgrade and since it looked like all went well, I tried to run the dev server and bumped into this error. Then I searched this error and found this thread… THEN I went to the release guide after you mentioned it
FYI @dom Has been coordinating the release notes and upgrade guides. Beyond publishing them, announcing them, and I believe linking to the guide post upgrade, I’m not sure what more can do to point to the steps needed to upgrade. Sometimes there are more steps.