Downshift: Error: isForwardRef not exported.

Created on 20 Nov 2018  路  6Comments  路  Source: downshift-js/downshift

  • downshift version: >= 3.1.3
  • node version: 10
  • npm (or yarn) version: latest

Relevant code or config

commonjs({
  include: 'node_modules/**',
  namedExports: {
    'react-is': ['isForwardRef', 'isValidElementType'],
  },
}),

What you did:
Upgrade downshift from version 3.1.2

What happened:

[!] Error: 'isForwardRef' is not exported by node_modules/downshift/node_modules/react-is/index.js
https://rollupjs.org/guide/en#error-name-is-not-exported-by-module-
node_modules/downshift/dist/downshift.esm.js (8:9)
 6: import React, { Component } from 'react';
 7: import PropTypes from 'prop-types';
 8: import { isForwardRef } from 'react-is';
             ^
 9:
10: // istanbul ignore next
Error: 'isForwardRef' is not exported by node_modules/downshift/node_modules/react-is/index.js

Problem description:

After upgrading from downshit 3.1.2 my rollup build throws the error above. I had a configuration for react-is used by my package itself and other dependencies. I also have react-is as a dependency.

help wanted needs investigation

Most helpful comment

If anyone else comes to this issue and needs a bit more help on this, you may need to update the key used in the namedExports config object in your Rollup config.

commonjs({
  include: 'node_modules/**',
  namedExports: {
    'react-is': ['isForwardRef', 'isValidElementType'],
  },
}),

or 

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

As always, your mileage may vary.

All 6 comments

I have no idea why that's happening. Based on https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module it looks like you're configuring things correctly... :-/

I'll try to investigate and double check if did everything correctly.

I did a fresh install of everything a 3rd time and everything work.
Closing this issue since I was not able to reproduce it again.

If anyone else comes to this issue and needs a bit more help on this, you may need to update the key used in the namedExports config object in your Rollup config.

commonjs({
  include: 'node_modules/**',
  namedExports: {
    'react-is': ['isForwardRef', 'isValidElementType'],
  },
}),

or 

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

As always, your mileage may vary.

The above solution doesn't work for me

the above solution doesn't work for me neither

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vincent-Alibert picture Vincent-Alibert  路  4Comments

gsimone picture gsimone  路  3Comments

lukyth picture lukyth  路  3Comments

klapouchy picture klapouchy  路  4Comments

kohgpat picture kohgpat  路  3Comments