How to fix the undefined reading 'use' error.

This article can help you if you've checked your browser console and found the following error on your website:

Uncaught TypeError: Cannot read properties of undefined (reading 'use')

Check if this error is caused by WP Rocket

Load your page while bypassing WP Rocket, by adding ?nowprocket to the URL (e.g. example.org?nowprocket), and check if the error exists there. 

If it does, WP Rocket is not the cause, and you should check for JavaScript options in other optimization plugins, or with a developer.

The error isn’t there on ?nowprocket

If the error shows up only when WP Rocket is active on the page, it’s related to Load JavaScript deferred.

To solve the error, add the following to the Excluded JavaScript Files field:

/wp-includes/js/dist/(.*)

This pattern will exclude the needed files to fix the issue.

In the end, it should look like this:

Full image size: https://jmp.sh/QHXtfrOG

After applying these exclusions, save the changes and the problem should be resolved.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.