相关文章推荐
好帅的排球  ·  关于React Server Compone ...·  3 月前    · 
听话的跑步鞋  ·  Day 14: React篇: ...·  2 月前    · 
鼻子大的领结  ·  记录一个boost1.72 ...·  1 年前    · 
宽容的苦咖啡  ·  spring boot 处理 ...·  3 年前    · 

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

184 line is:

/* 184 */ var Tippy$1 = Object(react__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(function TippyWrapper(props, _ref) {
  return react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Tippy, props, Object(react__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(props.children, {
    ref: function ref(node) {
      preserveRef(_ref, node);
      preserveRef(props.children.ref, node);
  }));
});

What am I doing wrong? 😢

React: 16.8.4
@tippy.js/react: 2.1.1

Try deleting node_modules and reinstalling everything fresh. It sounds like a webpack bug and not a problem with this lib because I can import on CodeSandbox/CRA just fine

Also make sure both react and react-dom are latest: https://stackoverflow.com/questions/53037928/typeerror-object-is-not-a-function-error-when-trying-to-use-react-hooks

It's definitely a problem with webpack, since it works fine in CRA/CodeSandbox which use webpack too...

Might need to post your webpack config here

resolve : { modules : [ './' , 'node_modules' ] , extensions : [ '.js' , '.jsx' , '.pcss' ] , alias : { 'react-dom' : '@hot-loader/react-dom' , plugins : [ new webpack . NoEmitOnErrorsPlugin ( ) ] ,

I also have this warning in docker container logs. It's so strange 🤔

WARNING in ./node_modules/@tippy.js/react/esm/index.js 189:21-27
"export 'useRef' was not found in 'react'
          

Another link.

  • Strange warning stating that export does not exist when it does webpack/webpack#7378
  • I'm going to have to close this because it's not a problem with this library, it's an environment/bundler issue. A fully reproducing link is required to debug this fruther.

    In case anyone else is having this issue after updating their webpack config's resolve.modules entry, make it sure contains the plain "node_modules" so that webpack can resolve dependencies using node_modules embedded in package. The node_modules embedding happens when a package depends on a different version of a package that already exists in the root node_modules