However, I got an error when I removed some components from example codes.
And the extension popup doesn't show content other than a small white background paper.
Before
import Button from "@mui/material/Button"
import Input from "@mui/material/Input"
import Link from "@mui/material/Link"
import Stack from "@mui/material/Stack"
import Typography from "@mui/material/Typography"
import { useState } from "react"
function IndexPopup() {
const [data, setData] = useState("")
return (
<Stack minWidth={240}>
<Typography variant="h6">
Welcome to your{" "}
<Link href="https://www.plasmo.com" target="_blank">
Plasmo
</Link>{" "}
Extension!
</Typography>
<Input onChange={(e) => setData(e.target.value)} value={data} />
<Button href="https://docs.plasmo.com" target="_blank">
View Docs
</Button>
</Stack>
)
}
export default IndexPopup
after(I removed
import Link from "@mui/material/Link"
import Stack from "@mui/material/Stack"
import Typography from "@mui/material/Typography"
function IndexPopup() {
return (
<Stack minWidth={240}>
<Typography variant="h6">
Welcome to your{" "}
<Link href="https://www.plasmo.com" target="_blank">
Plasmo
</Link>{" "}
Extension!
</Typography>
</Stack>
)
}
export default IndexPopup
When I removed <Button> and <Input> components caused the error.
so Keeping <Button> or <input> components in the code won't happen anything.
Then, the below also works well.
import Link from "@mui/material/Link"
import Stack from "@mui/material/Stack"
import Typography from "@mui/material/Typography"
import {Button} from "@mui/material";
function IndexPopup() {
return (
<Stack minWidth={240}>
<Typography variant="h6">
Welcome to your{" "}
<Link href="https://www.plasmo.com" target="_blank">
Plasmo
</Link>{" "}
Extension!
</Typography>
<Button sx={{ display: 'none' }} />
</Stack>
)
}
export default IndexPopup
I'd like to contribute to the project, but I don't have a good idea to fix it.
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output
In my developer console, I could see these logs.
INFO | [plasmo/parcel-runtime]: Connected to HMR server for /Users/{MASKED}plasmo-mui/plasmo-mui/node_modules/.pnpm/@plasmohq+parcel-transformer-manifest@0.18.0/node_modules/@plasmohq/parcel-transformer-manifest/runtime/plasmo-default-background.ts
runtime-b6cb8215118231ce.js:1 🟠 WARN | [plasmo/parcel-runtime]: Connection to the HMR server is closed for /Users/{MASKED}/plasmo-mui/plasmo-mui/node_modules/.pnpm/@plasmohq+parcel-transformer-manifest@0.18.0/node_modules/@plasmohq/parcel-transformer-manifest/runtime/plasmo-default-background.ts
emotion-styled-base.browser.esm.js:72 Uncaught TypeError: defaultShouldForwardProp is not a function
at createStyled (emotion-styled-base.browser.esm.js:72:10)
at styled (index.js:15:16)
at createStyled.js:164:26
at 1WVeJ.@babel/runtime/helpers/esm/objectWithoutPropertiesLoose (Typography.js:31:9)
at newRequire (popup.7d3dc21e.js:72:24)
at localRequire (popup.7d3dc21e.js:85:35)
at 25cbc../Typography (index.js:3:1)
at newRequire (popup.7d3dc21e.js:72:24)
at localRequire (popup.7d3dc21e.js:85:35)
at jirFr.@babel/runtime/helpers/esm/objectWithoutPropertiesLoose (Link.js:16:1)
runtime-864f818a799edc31.js:1 🔵 INFO | [plasmo/parcel-runtime]: Connected to HMR server for /Users/{MASKED}/plasmo-mui/plasmo-mui/.plasmo/static/popup.tsx
### (OPTIONAL) Contribution
- [X] I would like to fix this BUG via a PR
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
- [X] I checked the [current issues](https://github.com/PlasmoHQ/plasmo/issues?q=is%3Aopen+is%3Aissue+label%3Abug) for duplicate problems.
What happened?
I am installing Plasmo with MUI using examples/with-mui.
However, I got an error when I removed some components from example codes. And the extension popup doesn't show content other than a small white background paper.
Before
after(I removed
When I removed
<Button>
and<Input>
components caused the error. so Keeping<Button>
or<input>
components in the code won't happen anything.Then, the below also works well.
package.json
the error still happen when I create a new project and install MUI with these codes below.
I'd like to contribute to the project, but I don't have a good idea to fix it.
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Chrome
Relevant log output