squidfunk / mkdocs-material

Documentation that simply works
https://squidfunk.github.io/mkdocs-material/
MIT License
20.27k stars 3.48k forks source link

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

Closed oneumyvakin closed 23 hours ago

oneumyvakin commented 2 weeks ago

Context

No response

Bug description

lunrjs has en issue https://github.com/olivernn/lunr.js/issues/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:

Browser

No response

Before submitting

squidfunk commented 2 weeks ago

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 commented 1 day ago

Reopened due to https://github.com/ultrabug/mkdocs-static-i18n/issues/313#issuecomment-2355890746 and fixed in 8925cae63. 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 commented 23 hours ago

Released as part of 9.5.35.