Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *BLUF*
- When my application was bundled with Webpack 1 everything worked
- without error. However, when I upgraded to Webpack 4 the rc-tooltip
- component used in another package throws a runtime error of
- > warning.js:33 Warning: React.createElement: type is invalid
- > -- expected a string (for built-in components) or a class/function
- > (for composite components) but got: object.
- *Dependencies*
- ```
- - ProjectX (my web application)
- - ProjectY (my custom package)
- - rc-tooltip
- ```
- The webpack configuration for ProjectX is shown below.
- *Details*
- Under both versions, creation of the tooltip appears to be the same.
- ```
- React.createElement(Tooltip, my-props, my-childern):
- ```
- However, inspected what Tooltip actually is under Webpack 1 v Webpack 4
- and found a key difference.
- Under Webpack 1, on the console
- ```
- > Tooltip
- ƒ Tooltip() {
- var _ref;
- var _temp, _this, _ret;
- (0, _classCallCheck3['default'])(this, Tooltip);
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _…
- ```
- Under Webpack 4, on the console
- ```
- > Tooltip
- {default: ƒ, __esModule: true}default: ƒ Tooltip()__esModule: true__proto__: Object
- ```
- It appears that under Webpack 4 I am not receiving the properly
- exported class. In fact, on the console I can create a new React
- element without error via
- ```
- > React.createElement(Tooltip.default, my-props, my-childern):
- ```
- Why would Webpack 4 alter how a package is expressed in my application?
- Is this a configuration issue, what am I missing?
Add Comment
Please, Sign In to add comment