Hey I m trying to build…

less than 1 minute read

Hey, I’m trying to build a publishable library with styled components, but rollup complains: Error: 'typeOf' is not exported by node_modules/react-is/index.js

I found this commit in styled-components: https://github.com/styled-components/styled-components/commit/8836289376383ef317daf5cbf7e6be1737dbbede#diff-3860c23229b74b5f9583e1cab199516f And this issue in nx: https://github.com/nrwl/nx/issues/2212

But I know nothing about rollup. Any hints? [nrwl/nx] #2212 docs: Extend/Change the rollup configuration used to build libs

Responses:

This custom config file is getting merged, but it’s not fixing anything:

```module.exports = config => { console.log(‘####################’); console.dir(config, { depth: null });

const commonJsPluginIndex = config.plugins.findIndex(plugin => plugin.name === ‘commonjs’); config.plugins[commonJsPluginIndex] = { …config.plugins[commonJsPluginIndex], ignoreGlobal: true, namedExports: { ‘react-is’: [‘isElement’, ‘isValidElementType’, ‘ForwardRef’, ‘typeof’], }, };

console.log(‘####################’); console.dir(config, { depth: null });

return config; };```

Updated: