Skip to content

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

@oneumyvakin

Description

@oneumyvakin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions