Creating a yarn dependency resolution for an alias

21 views Asked by At

In package.json I have

  "dependencies": {
    "@reduxjs/toolkit": "^1.9.7",
    "react-redux": "5.0.7",
    "react-redux8": "npm:react-redux@^8.0",
    ...
  }

in my code I'm trying to include

import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

but I get errors during build with eg.

ERROR in ./node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.esm.js 496:31-41
"export 'useStore' (imported as 'rrUseStore') was not found in 'react-redux'

I've tried to handle this in the resolutions block using all of the following

"**/@reduxjs/toolkit/react-redux": "8.1.3",
"**/@reduxjs/toolkit/react-redux": "^8.0",
"**/@reduxjs/toolkit/react-redux": "npm:react-redux@^8.0",
"@reduxjs/toolkit/react-redux": "8.1.3",
"@reduxjs/toolkit/react-redux": "^8.0",
"@reduxjs/toolkit/react-redux": "npm:react-redux@^8.0",
"@reduxjs/toolkit/**/react-redux": "8.1.3",
"@reduxjs/toolkit/**/react-redux": "^8.0",
"@reduxjs/toolkit/**/react-redux": "npm:react-redux@^8.0",

none of which resolve the issue. Using overrides isn't an option since I'm using yarn and not npm.

Can yarn and resolutions be used for what I'm trying to do? I thought that was the point of resolutions.

0

There are 0 answers