Skip to content

Commit 6f80f35

Browse files
committed
Update documentation
1 parent c0efbe3 commit 6f80f35

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Read the [full review here](https://clutch.co/profile/shakacode#reviews?sort_by=
6666
- [Upgrading](#upgrading)
6767
- [2.3 to 2.4](#23-to-24)
6868
- [Common Errors](#common-errors)
69+
- [Getting warning for `Can't resolve 'react-dom/client'` in React < 18](#getting-warning-for-cant-resolve-react-domclient-in-react--18)
6970
- [During installation](#during-installation)
7071
- [Undefined Set](#undefined-set)
7172
- [Using TheRubyRacer](#using-therubyracer)
@@ -764,6 +765,22 @@ For the vast majority of cases this will get you most of the migration:
764765
- re-run `bundle exec rails webpacker:install:react` to update npm packages (Webpacker only)
765766

766767
## Common Errors
768+
### Getting warning for `Can't resolve 'react-dom/client'` in React < 18
769+
770+
You may see a warning like this when building a Webpack bundle using any version of React below 18. This warning can be safely [suppressed](https://webpack.js.org/configuration/other-options/#ignorewarnings) in your Webpack configuration. The following is an example of this suppression in `config/webpack/webpack.config.js`:
771+
772+
```diff
773+
- const { webpackConfig } = require('shakapacker')
774+
+ const { webpackConfig, merge } = require('shakapacker')
775+
776+
+const ignoreWarningsConfig = {
777+
+ ignoreWarnings: [/Module not found: Error: Can't resolve 'react-dom\/client'/],
778+
+};
779+
780+
- module.exports = webpackConfig
781+
+ module.exports = merge({}, webpackConfig, ignoreWarningsConfig)
782+
```
783+
767784
### During installation
768785
1) While using installers.(rails webpacker:install:react && rails webpacker:install)
769786
Error:

0 commit comments

Comments
 (0)