Automattic / Automattic/jetpack

Instant Search: look into conflict with Autoptimize plugin

Open
#22,562 0 comments 0 reactions 0 assignees View on GitHub
[Feature] Search [Focus] Compatibility [Pri] Low Enhancement
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

When using Jetpack Search in combination with the [Autoptimize plugin](https://wordpress.org/plugins/autoptimize/), one can run into issues like below:

```
Uncaught TypeError: r is undefined
3984 /wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
c /wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
jp-search.js:1:408
3984 /wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
c /wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js?minify=false&ver=85aa6312819011fa991e15e1b8b67873:1
```

It would be nice if we could work around that.

****

Reported here:
p8oabR-Nm-p2#comment-5954

Contributor guide

Open the contributing guide

Research direction

Reproduce Instant Search with the Autoptimize plugin enabled, then inspect the failure in jetpack_vendor/automattic/jetpack-search/build/instant-search/jp-search.js. Trace the reported TypeError and determine a compatible workaround; done means Instant Search no longer throws this error when both plugins are active.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.