i am using rollup to build a react custom library npm and getting this error and not able to fix this issue i tried to search it but did not get anything which is helpful so i am posting this to see if someone can help me with this
./src/index.js → dist/index.js, dist/index.es.js...
[!] Error: 'withKnobs' is not exported by node_modules/@storybook/addon-knobs/dist/index.js, imported by src/components/Multiselectdropdown/Multiselectdropdown.js
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/components/Multiselectdropdown/Multiselectdropdown.js (2:9)
1: import React, { useState } from "react";
2: import { withKnobs, text, boolean, color} from '@storybook/addon-knobs';
^
3: import '../../../src/multiselectdropdown.css';
Error: 'withKnobs' is not exported by node_modules/@storybook/addon-knobs/dist/index.js, imported by src/components/Multiselectdropdown/Multiselectdropdown.js
at error (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:198:30)
at Module.error (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:12560:16)
at Module.traceVariable (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:12919:29)
at ModuleScope.findVariable (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:11571:39)
at Identifier.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:7570:40)
at ArrayExpression.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:5396:73)
at Property.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:5400:23)
at ObjectExpression.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:5396:73)
at ExportDefaultDeclaration.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:5400:23)
at Program.bind (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:5396:73)
at Module.bindReferences (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:12556:18)
at Graph.sortModules (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:23193:20)
at Graph.build (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:23071:14)
at C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:23768:13
at catchUnfinishedHookActions (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:23247:20)
at rollupInternal (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\shared\rollup.js:23765:5)
at build (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\bin\rollup:1528:20)
at runRollup (C:\Users\imran\npmpackage\multiselect-package\node_modules\rollup\dist\bin\rollup:1668:21)
You should check the documentation of the package where it might state that the version if you are using and the latest one has the same exported function or not.
If the problem still persist try reinstalling the package and doing the cache clean too.