Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prop-types version dependency for scrollbar #92

Open
shkadiyam opened this issue Oct 30, 2020 · 2 comments
Open

prop-types version dependency for scrollbar #92

shkadiyam opened this issue Oct 30, 2020 · 2 comments

Comments

@shkadiyam
Copy link

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
Copy link
Owner

rommguy commented Oct 31, 2020

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
Copy link
Owner

rommguy commented Jan 27, 2021

Hi @shkadiyam, can I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants