question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in production when building with vite 2.9

See original GitHub issue

First and foremost, thank you for this package. It has helped me easily manage the state of Popup components in a project that I am working on!

Unfortunately, I am experiencing a bug in my production environment that is similar to issue #88. The issue does not occur in my dev environment. However, in my production environment which utilizes the vite build script, I am receiving the following error:

Uncaught TypeError: te.usePopupState is not a function

This is the import statement that I am using:

import { usePopupState } from "material-ui-popup-state/hooks";

Would greatly appreciate it if someone could help me resolve this issue. Thanks!

I am using: react: 18.2.0 Vite: 2.9.9 material-ui-popup-state: 4.0.1 @mui/material: 5.3.0

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ninomancommented, Aug 9, 2022

Hey @ssh000 I’m going to try rollupOptions.output.manualChunks option you mentioned, currently what I was doing as a workaround, was importing whole material-ui-popup-state and just spreading it in the file

0reactions
HasaanSultancommented, Nov 21, 2022

@jedwards1211 I am facing same issue, with Vite 3.1.3. Also tried plugins: [splitVendorChunkPlugin()]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building for Production - Vite
When it is time to deploy your app for production, simply run the vite build command. ... From Vite 2.9, manualChunks is no...
Read more >
Production build generates broken application #8777 - GitHub
Describe the bug When running the provided application in dev mode, it works as expected. However, when built for production and launched, ...
Read more >
Vite production build fails (React) - Stack Overflow
I have a web app created with create-react-app that I am trying to migrate to vite, but it is not working when I...
Read more >
Get Started with ActiveReportsJS Report Viewer in Vite.js(React)
Run and test the application ... If the command fails with the error that says that 'vite' is not recognized as an internal...
Read more >
Error in production mode using Vite VueJS - Web - VTK
The project is built with Vuejs Vite tools. When I test the app running yarn dev the volume is rendered correctly, but as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found