docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Missing dependency tslib

Open hjellek opened this issue 2 years ago • 1 comments
trafficstars

Please describe the bug you are seeing

Installing docusaurus with pnpm (which have stricter defaults to hoisting) causes this plugin to be unable to import tslib, as it is not declared as a dependency.

Docusaurus itself correctly specifies this dependency: https://github.com/facebook/docusaurus/blob/3f09fb11a12950c9419ae38fb1b7a04ec1ec8e66/packages/docusaurus/package.json#L98

How can we best reproduce the bug?

No response

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

Docusaurus 2.4.1 docusaurus-local-search 1.1.0

Which Node.js version are you using?

No response

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

No response

Additional context

No response

hjellek avatar Sep 11 '23 08:09 hjellek

@docusaurus/utils-validation is missing too from the deps.

The overrides part is there because I'm using the search-local pkg with docusaurus v3 (via).

I use this as a workaround in my package.json with pnpm (pnpm docs packageExtensions):

"pnpm": {
    "packageExtensions": {
      "@cmfcmf/docusaurus-search-local": {
        "dependencies": {
          "tslib": "*",
          "@docusaurus/utils-validation": "*"
        }
      }
    },
    "overrides": {
      "@docusaurus/core": "^3.2.1"
    }
  }

mkska avatar May 02 '24 17:05 mkska

Thank you, both are added now.

cmfcmf avatar Jun 09 '24 12:06 cmfcmf