Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Error: Can't resolve '@theme/hooks/useDocs' #93

Closed
homotechsual opened this issue Jan 24, 2022 · 7 comments
Closed

[Bug] Error: Can't resolve '@theme/hooks/useDocs' #93

homotechsual opened this issue Jan 24, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@homotechsual
Copy link

Please describe the bug you are seeing

Can't build with canary using this plugin. Looks like useDocs has been replaced by @docusaurus/plugin-content-docs/client.

facebook/docusaurus#6287

How can we best reproduce the bug?

No response

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

@cmfcmf/docusaurus-search-local@0.9.4
@docusaurus/core@0.0.0-4470

Which Node.js version are you using?

v16.13.2

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

require.resolve("@cmfcmf/docusaurus-search-local"),
{
indexDocs: true,
indexBlog: false,
indexPages: true,
language: "en"
}

Additional context

No response

@homotechsual homotechsual added the bug Something isn't working label Jan 24, 2022
@pklaschka
Copy link

pklaschka commented Jan 27, 2022

I can confirm this. It breaks when updating @docusaurus/preset-classic from 2.0.0-beta.14 to 2.0.0-beta.15.

According to their changelog, the hooks were moved from @theme/hooks to @docusaurus/theme-common:

docusaurus-theme-classic, docusaurus-theme-common, docusaurus-theme-live-codeblock, docusaurus-theme-search-algolia
#6289 refactor: move @theme/hooks to @docusaurus/theme-common

(linking to facebook/docusaurus#6289)

@edumaciel10
Copy link

I am getting the same error here

@slorber
Copy link

slorber commented Jan 28, 2022

Hi

This hook is considered an internal API, can you explain how it is used?

Are there other internal apis that you are using?

@cmfcmf cmfcmf self-assigned this Jan 28, 2022
cmfcmf added a commit that referenced this issue Jan 28, 2022
BREAKING CHANGE: the minimum supported Docusaurus version is now v2.0.0-beta10.
@cmfcmf cmfcmf closed this as completed in 22aaf1d Jan 28, 2022
@cmfcmf
Copy link
Owner

cmfcmf commented Jan 28, 2022

This hook is considered an internal API, can you explain how it is used?

The use of this hook was a remnant of when useContextualSearchFilters was not yet available in @docusaurus/theme-common. I now dropped support for older Docusaurus versions and removed the use of these internal APIs.

Are there other internal apis that you are using?

I am not 100% sure :) It definitely feels like I am using less and less internal APIs with each new beta of Docusaurus.

cmfcmf added a commit that referenced this issue Jan 28, 2022
BREAKING CHANGE: the minimum supported Docusaurus version is now v2.0.0-beta15.
@cmfcmf
Copy link
Owner

cmfcmf commented Jan 28, 2022

Fixed in v0.10.0.

@pklaschka
Copy link

@cmfcmf Thank you for the quick fix!

@slorber
Copy link

slorber commented Feb 2, 2022

great, thanks :)

Let me know if you have a use-case for another internal API in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants