Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null rendered into the bundle when bundling a @mui/lab/TreeView component #51

Open
dagda1 opened this issue Sep 23, 2022 · 1 comment
Open

Comments

@dagda1
Copy link

dagda1 commented Sep 23, 2022

Describe the bug A clear and concise description of what the bug is.

I encountered a weird bug when trying to render a @mui/lab/TreeView component.

When packup is bundling the assets, the error below happens

aaa

If I use vite to bundle then the error goes away.

To Reproduce Steps to reproduce the behavior:

  1. I created this repo with reproduction and proof that it works with vite
  2. There are instructions in the README and below
  3. Clone the repo
  4. deno task build
  5. deno task dev --app-path=./dist

Expected behavior A clear and concise description of what you expected to

It should run without errors

Screenshots If applicable, add screenshots to help explain your problem.

aaa

@N8Brooks
Copy link

N8Brooks commented Apr 2, 2023

Doesn't seem to be an issue with set-up as follows. Having trouble with the styling though.

import * as React from "https://esm.sh/[email protected]";
import { createRoot } from "https://esm.sh/[email protected]/client";
import {
  AppBar,
  Box,
  Button,
  Container,
  createTheme,
  CssBaseline,
  IconButton,
  ThemeProvider,
  Toolbar,
  Typography,
  useMediaQuery,
} from "https://esm.sh/@mui/[email protected]";
import {} from "https://esm.sh/@emotion/[email protected]";
import {} from "https://esm.sh/@emotion/[email protected]";
import MenuIcon from "https://esm.sh/@mui/[email protected]/Menu";

function App() {
  const isDarkModePreferred = useMediaQuery("(prefers-color-scheme: dark)");
  const theme = React.useMemo(
    () =>
      createTheme({
        palette: {
          mode: isDarkModePreferred ? "dark" : "light",
        },
      }),
    [isDarkModePreferred],
  );
  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <Box sx={{ flexGrow: 1 }}>
        <AppBar position="static">
          <Toolbar>
            <IconButton
              size="large"
              edge="start"
              color="inherit"
              aria-label="menu"
              sx={{ mr: 2 }}
            >
              <MenuIcon />
            </IconButton>
            <Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
              News
            </Typography>
            <Button color="inherit">Login</Button>
          </Toolbar>
        </AppBar>
        <Container component="main">
          <Typography variant="h1">News</Typography>
        </Container>
      </Box>
    </ThemeProvider>
  );
}

createRoot(document.querySelector("body")!).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants