Skip to content

Error when trying to build with rollup styled-components and react #1654

@kopax

Description

@kopax

I have the following error which just appeared when I try to build with the latest version of react
and styled-component.

This is how I try to build with rollup :

> rollup-umd@0.6.8 build:lib /mnt/mesos/sandbox/builds/dev-tools/super-tool/rollup-styled
> BABEL_ENV=production babel --out-dir lib src
src/index.js → dist/super-tool.js, dist/super-tool.es.js...
[!] Error: 'cloneElement' is not exported by node_modules/react/index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules/styled-components/dist/styled-components.es.js (4:27)
2: import Stylis from 'stylis';
3: import _insertRulePlugin from 'stylis-rule-sheet';
4: import React, { Component, cloneElement, createElement } from 'react';
                              ^
5: import stream from 'stream';
6: import PropTypes from 'prop-types';

version

  • react@16.3.0
  • styled-components@3.2.2

Did anything change recently ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions