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

Since 8.3.7 search does not work in browser if there is Vietnamese locale in i18n plugin #7498

Closed
4 tasks done
oneumyvakin opened this issue Sep 2, 2024 · 3 comments
Closed
4 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@oneumyvakin
Copy link

Context

No response

Bug description

lunrjs has en issue olivernn/lunr.js#324 when working in strict mode ("use strict";)
Since 8.3.7 "use strict"; added to the beginning of search bundle.
This lead to the issue search in blower doesn't work because of JS error

search.07f07601.min.js:8 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'console')
at Object.warn (search.07f07601.min.js:8:61)
at t.Pipeline.warnIfFunctionNotRegistered (search.07f07601.min.js:17:393)
at t.Pipeline. (search.07f07601.min.js:18:319)
at Array.forEach ()
at t.Pipeline.add (search.07f07601.min.js:18:288)
at t.Builder. (lunr.multi.min.js:1:686)
at t.Builder.use (search.07f07601.min.js:40:3184)
at t.Builder. (search.07f07601.min.js:40:17975)
at t (index.ts:192:2)
at new H (search.07f07601.min.js:40:17829)

This issue happened only if Vietnamese locale exists in i18n plugin

Related links

Reproduction

Uploading 9.5.33-vietnamese-search.zip…

Steps to reproduce

  1. Define mkdocs:
site_name: My Docs

theme:
  name: material

plugins:
  - search
  - i18n:
        languages:
              - locale: vi
                name: Vietnamese
                default: true
                build: yes
                nav_translations:
                  test: Hướng
  1. mkdocs serve --dev-addr=0.0.0.0:8000
  2. Try to search something.
  3. Check browsers console.

Browser

No response

Before submitting

@squidfunk
Copy link
Owner

squidfunk commented Sep 2, 2024

Thanks for reporting. Please report this to the i18n plugin. We don't officially support this plugin, and without it, Vietnamese search works, so it must be related to the plugin. Closing as upstream.

@squidfunk
Copy link
Owner

Reopened due to ultrabug/mkdocs-static-i18n#313 (comment) and fixed in 8925cae. This still prints a warning, which we'd need to take to Lunr Languages, as I've tried to fix it but to no avail. However, search works now.

@squidfunk squidfunk reopened this Sep 17, 2024
@squidfunk squidfunk added bug Issue reports a bug resolved Issue is resolved, yet unreleased if open and removed upstream Issue must be taken upstream labels Sep 17, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants