Skip to content

Error while using search module #2

Closed Answered by razonyang
sid-r-singh asked this question in Q&A
Discussion options

You must be logged in to vote

Do you have a public repo for reproducing?

According to the logs, it maybe caused by the {{ $js := resources.Get "main.ts" | js.Build }}.
The main.ts is the JS source of the theme/site, when there isn't assets/main.ts in the theme/site, then it fails, so if you're not using Hugo pipes to build the theme's JS, please use the following instead.

{{ partial "search/assets/js" . }}

The code snippet you used is intended to combine the search JS and theme/site JS into one bundle/file to reduce HTTP requests.

I must admit that the docs are unclear, will update the docs later, sorry for the inconvenient.

Btw, similarly, the main.scss is the theme/site's styles file.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@sid-r-singh
Comment options

@razonyang
Comment options

Answer selected by sid-r-singh
@sid-r-singh
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants