Open dtlhlbs opened 1 year ago
I have the same issue.
My Metadata is the same, however I use npm
instead of yarn
and I swizzled the SearchBar
component using the Typescript flag.
The issue seems to the relative path to the client
module in the following line (inside src/theme/SearchBar/index.tsx
- directory created by running the swizzling command)
import {useTypesenseContextualFilters} from '../../client';
I tried to manually change the path to the client
module by replacing the previous import statement as such:
import { useTypesenseContextualFilters } from "docusaurus-theme-search-typesense/lib/client/index";
But got
Module not found: Error: Package path ./lib/client/index is not exported from package <redacted>/node_modules/docusaurus-theme-search-typesense (see exports field in <redacted>/node_modules/docusaurus-theme-search-typesense/package.json)
client (webpack 5.75.0) compiled with 1 error
And also as such
import { useTypesenseContextualFilters } from "docusaurus-theme-search-typesense/src/client/index";
But got again
Module not found: Error: Package path ./lib/client/index is not exported from package <redacted>/node_modules/docusaurus-theme-search-typesense (see exports field in <redacted>/node_modules/docusaurus-theme-search-typesense/package.json)
client (webpack 5.75.0) compiled with 1 error
Just noting here that Ejecting SearchPage
also gives errors:
Module not found: Error: Can't resolve '../../hooks/useSearchPage' in 'C:\Users\DavidL\source\repos\hilltop-docs\content\src\theme\SearchPage'
Module not found: Error: Can't resolve '../../utils/generalUtils' in 'C:\Users\DavidL\source\repos\hilltop-docs\content\src\theme\SearchPage'
Description
When I try to swizzle the docusaurus-theme-search-typesense SearchBar component it fails to compile docusaurus with an error.
Steps to reproduce
yarn run swizzle docusaurus-theme-search-typesense SearchBar
yarn start
Expected Behavior
Local Docusaurus will start without error with a copied version of the typesense searchbar as it was previously
Actual Behavior
Docusaurus launches with an error:
Metadata
docusaurus/core: 2.2.0 docusaurus-theme-search-typesense: 0.8.0