-
Notifications
You must be signed in to change notification settings - Fork 720
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
The search index is not available #1247
Comments
Check your browser console when trying to load search - are some errors showing up? Search should be enabled by default. |
It says search.js 404. Here's my config: "typedocOptions": {
"excludeExternals": true,
"excludeNotExported": true,
"excludePrivate": true,
"excludeProtected": true,
"inputFiles": "src",
"out": "docs"
}, |
search.js isn't used anymore in 0.17.4, it should be looking for search.json. What version of |
I have installed |
If you run |
npm ls --depth=1
|
Try serving de docs with something like https://www.npmjs.com/package/serve
The search component is doing a fetch, and on the other hand the search.js file is being injected with |
It's a theme problem. I swap it out and if works fine. Sorry for the mess. |
Is there a strong reason for the removal of this |
Good question, I believe @sgrishchenko's original motivation was to reduce the possibility for code injection. As a part of the transition to JSON, it also improved the page load speed by doing indexing when building the docs rather than whenever anyone loaded the page. The latter is more important to me than storing it in a JSON file, and I agree that it would be nice to be able to use the docs without starting a server... I'd be open to reverting to a JS file. |
@Fleker Sorry, but I don't understand why we should use JavaScript to transfer static data? If you want use brouser preview, you can use json file the same way, here the screen of json from my documentation site (https://sgrishchenko.github.io/reselect-utils/typedoc/light/assets/js/search.json). It works fine for me. |
@sgrishchenko that approach works fine when you are hosting the files on GitHub or some other server, but it does not work if you try to open the files locally
Unless I take the advice above and have to spin up a local server using Having an improvement in speed is definitely beneficial, but being able to run locally through some fallback behavior would still be useful. The theme
which could return to provide some sort of substitute implementation when the script is activated. |
@Fleker Oh, now I see, thank you, but it looks like a hack for me. What if tomorrow Google Chrome or Firefox says that JS files should be loaded via "http" or "https" too? Shall we explore another hack to make workaround for this case? |
@Fleker But may be it is not bad to make some hacks to improve DX, maybe it will be better to have two modes: development and production. JS will be used in development mode and JSON - in production. Or maybe typedoc should start up some development server (e.g. webpack-dev-server) like CRA or Storybook does. |
If Chrome or Firefox implemented a particular limitation, then it'd probably make sense for Typedoc to make another workaround as Typedoc is built for web browsers and are tied to platform requirements. Having a development mode, which would be functionally the same as production, would be beneficial in trying out the doc rendering quickly. |
It's my typedoc.json file
What can I do to use search
The text was updated successfully, but these errors were encountered: