wizbii / strapi-plugin-strapi-algolia

A strapi plugin that index items to algolia
https://market.strapi.io/plugins/strapi-plugin-strapi-algolia
9 stars 3 forks source link

[v5] Could not resolve "@strapi/design-system/Button" #11

Closed gmoigneu closed 5 days ago

gmoigneu commented 3 weeks ago

Even with the design system installed on v5, the plugin can not find the button.

yarn add react react-dom @strapi/design-system @strapi/icons styled-components

Error:

✘ [ERROR] Could not resolve "@strapi/design-system/Button"

    node_modules/strapi-plugin-strapi-algolia/admin/src/components/IndexAllButton/index.tsx:1:23:
      1 │ import { Button } from '@strapi/design-system/Button';
        ╵                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Importing the directory "./dist/Button" is forbidden by this package:

    node_modules/strapi-plugin-strapi-algolia/node_modules/@strapi/design-system/package.json:23:11:
      23 │     "./*": "./dist/*"
         ╵            ~~~~~~~~~~

  The presence of "exports" here makes importing a directory forbidden:

    node_modules/strapi-plugin-strapi-algolia/node_modules/@strapi/design-system/package.json:9:2:
      9 │   "exports": {
        ╵   ~~~~~~~~~

  Import from "@strapi/design-system/Button/index.js" to get the file
  "node_modules/strapi-plugin-strapi-algolia/node_modules/@strapi/design-system/dist/Button/index.js":

    node_modules/strapi-plugin-strapi-algolia/admin/src/components/IndexAllButton/index.tsx:1:52:
      1 │ import { Button } from '@strapi/design-system/Button';
        │                                                     ^
        ╵                                                     /index.js

  You can mark the path "@strapi/design-system/Button" as external to exclude it from the bundle,
  which will remove this error and leave the unresolved path in the bundle.

6:16:40 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
node_modules/strapi-plugin-strapi-algolia/admin/src/components/IndexAllButton/index.tsx:1:23: ERROR: Could not resolve "@strapi/design-system/Button"
    at failureErrorWithLog (/Users/nls/projects/arkea-rebuild/backend/node_modules/@strapi/strapi/node_modules/vite/node_modules/esbuild/lib/main.js:1651:15)
    at /Users/nls/projects/arkea-rebuild/backend/node_modules/@strapi/strapi/node_modules/vite/node_modules/esbuild/lib/main.js:1059:25
    at /Users/nls/projects/arkea-rebuild/backend/node_modules/@strapi/strapi/node_modules/vite/node_modules/esbuild/lib/main.js:1527:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Let me know if I miss a simple configuration somewhere.