react-tooltip: ESLint warning: Package subpath './dist/react-tooltip' is not defined

Describe the bug When importing:

import 'react-tooltip/dist/react-tooltip.css';

I see the following error through eslint:

Resolve error: Package subpath './dist/react-tooltip' is not defined by "exports" in /Users/[username]/Sites/[projectname]/node_modules/react-tooltip/package.json

I’m not sure exactly where ‘./dist/react-tooltip’ is being requested (not in my codebase), but adding this to the react-tooltip package exports resolves it:

"exports": {
    ...
    "./dist/react-tooltip": "./dist/react-tooltip.cjs.js"
  },

Version of Package v5.10.1-beta.4

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

thanks for confirming @binomialstew

And this one?

Beta version:

yarn add react-tooltip@5.10.6-beta.1005.2

or

npm i react-tooltip@5.10.6-beta.1005.2

Commit: 74327ca

This fixes it, yes.