Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

[!] Error: 'default' is not exported by ../../node_modules/prop-types/index.js #361

@samonxian

Description

@samonxian

rollup config

// rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';

export default {
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'umd',
    name: umdName,
    indent: false,
    sourcemap: false,
  },
  plugins: [
    nodeResolve(),
    commonjs({
      include: 'node_modules/**', // Default: undefined
    }),
  ],
};

When running rollup -c,it will throw the error.
I have been looking for this problem for a while, but there is no solution.
But when using commonjs without any options,it wok fine.

// rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';

export default {
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'umd',
    name: umdName,
    indent: false,
    sourcemap: false,
  },
  plugins: [
    nodeResolve(),
    commonjs(),
  ],
};

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