[gatsby-plugin-preact] Can't resolve 'react-dom' for node_modules package
See original GitHub issueDescription
ERROR #98123 WEBPACK
Generating SSR bundle failed
Can't resolve 'react-dom' in '[...]/node_modules/@tippyjs/react/dist'
Steps to reproduce
npx gatsby new bug-repro
yarn add @tippyjs/react gatsby-plugin-preact
- Add the Preact plugin to
gatsby.config.js
- Edit
index.js
with
import React from "react"
import { Link } from "gatsby"
import Tippy from "@tippyjs/react"
import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
const IndexPage = () => (
<Layout>
<SEO title="Home" />
<Tippy content="test">
<button>test</button>
</Tippy>
</Layout>
)
export default IndexPage
Expected result
No error
Actual result
Error
Environment
System:
OS: macOS 10.15.3
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.12.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 81.0.4044.122
Firefox: 75.0
Safari: 13.0.5
npmPackages:
gatsby: ^2.20.36 => 2.20.36
gatsby-image: ^2.2.19 => 2.3.5
gatsby-plugin-catch-links: ^2.1.9 => 2.2.4
gatsby-plugin-client-side-redirect: 0.0.2 => 0.0.2
gatsby-plugin-emotion: ^4.1.18 => 4.2.3
gatsby-plugin-google-analytics: ^2.1.16 => 2.2.5
gatsby-plugin-manifest: ^2.2.16 => 2.3.7
gatsby-plugin-mdx: ^1.1.5 => 1.1.11
gatsby-plugin-offline: ^3.0.7 => 3.1.5
gatsby-plugin-preact: ^3.2.4 => 3.2.4
gatsby-plugin-react-helmet: ^3.1.7 => 3.2.5
gatsby-plugin-sharp: ^2.2.22 => 2.5.7
gatsby-redirect-from: ^0.2.1 => 0.2.1
gatsby-remark-autolink-headers: ^2.1.10 => 2.2.4
gatsby-remark-vscode: ^2.0.3 => 2.0.3
gatsby-source-filesystem: ^2.1.22 => 2.2.5
gatsby-transformer-remark: ^2.6.22 => 2.7.5
gatsby-transformer-sharp: ^2.2.14 => 2.4.7
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Can't resolve 'react-dom' in '/path/node_modules/gatsby-react ...
You can have this error when moving from Gatsby v1 to v2. There's an official upgrade guide available here: ...
Read more >Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >gatsby-plugin-react-svg - npm
Start using gatsby-plugin-react-svg in your project by running `npm i gatsby-plugin-react-svg`. There are 108 other projects in the npm ...
Read more >Ugrading MDB React Gatsby project to Pro
p>I have a project I build using MDB React and Gatsby using this blog post as a ... Can't resolve 'react-router-dom' in '/Users/viccooper/Desktop/HearRo...
Read more >the `@emotion/core` package has been renamed to ... - You.com
Module not found: Error: Can't resolve '@emotion/react ... erroring out because it relies upon gatsby-plugin-emotion and @emotion/core , the latter of which ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to add
preact
to your dependencies as well, not just the plugin.Ah always the little things, @Grsmto is correct, added preact into my reproduction for this and it works now.