Material-ui: isFragment is not exported by node_modules/react-is/index.js

Created on 11 Dec 2019  路  6Comments  路  Source: mui-org/material-ui

  • [ ] The issue is present in the latest release.
  • [X] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

When trying to generate a build with rollup the above error is thrown:

isFragment is not exported by node_modules/react-is/index.js

Expected Behavior 馃

It should build succesfully.

Steps to Reproduce 馃暪

Build with rollup and you'll see the result..

Your Environment 馃寧

| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.6.0 |
| React | v16.4.1 |
| Browser | chrome |
| TypeScript | mix |
| Material-UI Lab | v 4.0.0-alpha.34 |

Screenshot

Screenshot 2019-12-11 at 16 54 53

Most helpful comment

I'm still running into this issue using material-ui core 4.8.3 and lab 4.0.0-alpha.39

[!] Error: 'isFragment' is not exported by node_modules/react-is/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/@material-ui/core/esm/Tabs/Tabs.js (5:9)
3: import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4: import React from 'react';
5: import { isFragment } from 'react-is';
            ^
6: import PropTypes from 'prop-types';
7: import clsx from 'clsx';

@kevinvugts Is this a rollup problem? Suggestions on what to change? I've just started working with that, using the default config generated by create-react-library, so I'm not really sure how to fix it.

EDIT: Fixed by adding to the rollup commonjs section:

    commonjs({
      include: 'node_modules/**',
      namedExports: {
        'node_modules/react-is/index.js': ['isFragment', 'ForwardRef']
      }
    })

All 6 comments

This was fixed in the lastest version.

I have this fix in mind #18551

isFragment is exported in https://unpkg.com/browse/[email protected]/cjs/react-is.development.js, we should be fine.

This was fixed in the lastest version.

I upgraded to the latest material-ui/lab version but it did not fix it for me.

Update - it was in my rollup config..

I'm still running into this issue using material-ui core 4.8.3 and lab 4.0.0-alpha.39

[!] Error: 'isFragment' is not exported by node_modules/react-is/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/@material-ui/core/esm/Tabs/Tabs.js (5:9)
3: import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4: import React from 'react';
5: import { isFragment } from 'react-is';
            ^
6: import PropTypes from 'prop-types';
7: import clsx from 'clsx';

@kevinvugts Is this a rollup problem? Suggestions on what to change? I've just started working with that, using the default config generated by create-react-library, so I'm not really sure how to fix it.

EDIT: Fixed by adding to the rollup commonjs section:

    commonjs({
      include: 'node_modules/**',
      namedExports: {
        'node_modules/react-is/index.js': ['isFragment', 'ForwardRef']
      }
    })

@kevinvugts what was wrong with your rollup config?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chris-hinds picture chris-hinds  路  3Comments

FranBran picture FranBran  路  3Comments

sys13 picture sys13  路  3Comments

TimoRuetten picture TimoRuetten  路  3Comments

mb-copart picture mb-copart  路  3Comments