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

Issue with @mui/utils package dependency #309

Open
paulm17 opened this issue Nov 8, 2024 · 1 comment
Open

Issue with @mui/utils package dependency #309

paulm17 opened this issue Nov 8, 2024 · 1 comment
Assignees
Labels
dependencies Update of dependencies status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite

Comments

@paulm17
Copy link

paulm17 commented Nov 8, 2024

Steps to reproduce

Build a package using @pigment/css react and use rollup.

Current behavior

Without the vite sidestep. I get the following issues:

Uncaught SyntaxError: The requested module 'node_modules/prop-types/index.js' does not provide an export named 'default' (at elementAcceptingRef.js:1:8)

Uncaught SyntaxError: The requested module 'node_modules/react-is/index.js' does not provide an export named 'ForwardRef' (at getDisplayName.js:1:10)

relevant links:
https://stackoverflow.com/a/44868718/439750
mui/material-ui#18791
react-component/util#105

Expected behavior

These issues should not exist.

Context

I'm using pigment-css as part of a custom UI library. With tsup this issue isn't present. However using rollup it is.

To sidestep the issue, I have added the following to my vite config:

optimizeDeps: {
    include: ['prop-types', 'react-is'],
  },
  resolve: {
    alias: {
      'prop-types': 'prop-types/prop-types.js',
      'react-is': 'react-is/cjs/react-is.development.js',
    },
  },

Search keywords: vite build

@paulm17 paulm17 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 8, 2024
@zannager zannager added dependencies Update of dependencies vite labels Nov 11, 2024
@brijeshb42
Copy link
Contributor

This is a known issue (mainly with Vite and indirectly Rollup) and will be fixed when we have the stable release (when we remove prop-types usage).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Update of dependencies status: waiting for maintainer These issues haven't been looked at yet by a maintainer vite
Projects
None yet
Development

No branches or pull requests

3 participants