rommguy / react-custom-scroll

Easily customize the browser scroll bar with native OS scroll behavior
MIT License
556 stars 66 forks source link

prop-types version dependency for scrollbar #92

Open shkadiyam opened 4 years ago

shkadiyam commented 4 years ago

While using this package if we do not specify prop-type (15.0.0) as peer dependency, we are seeing this error, and it is forcing us to include that as peer dependency in our project, can we remove it from peer dependency?

src/index.jsx → dist/index.cjs.js, dist/index.esm.js...
babelHelpers: 'bundled' option was used by default. It is recommended to configure this option explicitly, read more here: https://github.com/rollup/plugins/tree/master/packages/babel#babelhelpers
[!] Error: 'oneOf' is not exported by node_modules/prop-types/index.js, imported by node_modules/react-scrollbars-custom/dist/rsc.esm.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
node_modules/react-scrollbars-custom/dist/rsc.esm.js (2:9)
1: import { cnb } from 'cnbuilder';
2: import { oneOf, func, bool, number, string, object } from 'prop-types';
            ^
3: import { createElement, createRef, Component, createContext } from 'react';
4: import { zoomLevel } from 'zoom-level';
Error: 'oneOf' is not exported by node_modules/prop-types/index.js, imported by node_modules/react-scrollbars-custom/dist/rsc.esm.js
    at error (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:5251:30)
    at Module.error (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:9810:16)
    at handleMissingExport (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:9699:28)
    at Module.traceVariable (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:10200:24)
    at ModuleScope.findVariable (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:8731:39)
    at Identifier$1.bind (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:4137:40)
    at CallExpression$1.bind (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:2867:23)
    at CallExpression$1.bind (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:6628:15)
    at VariableDeclarator.bind (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:2867:23)
    at VariableDeclaration.bind (/var/jenkins/workspace/react-foundation_14_63014_1/node_modules/rollup/dist/shared/rollup.js:2863:31)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[Pipeline] }
rommguy commented 4 years ago

First, I'm happy to see you are using this project, always nice to know. I don't understand the issue - I defined prop-types and a peer dependency, and peer dependencies are by definition optional. It seems like the error is coming from babel, due to something in your babel config that tries to bundle the peer dependencies.

CustomScroll doesn't require prop-types to work

rommguy commented 3 years ago

Hi @shkadiyam, can I close this issue?