Uncaught ReferenceError: wp is not defined
-
Hi there,
I installed WooCommerce for the first time and right now are in the progress of creating/modifying the necessary pages for the users.When i drop the “All products” block on the shop page in Gutenberg editor, my 3 test-products are shown fine.
But when i visit the actual page, i get the following error:
Uncaught ReferenceError: wp is not defined at bortec-tuning.de/:2:843At the above location there is this snippet:
<script type='text/javascript' id='wp-api-fetch-js-after'>wp.apiFetch.use(wp.apiFetch.createRootURLMiddleware( "https://bortec-tuning.de/wp-json/" ) ); wp.apiFetch.nonceMiddleware = wp.apiFetch.createNonceMiddleware( "9f1078e68b" ); wp.apiFetch.use( wp.apiFetch.nonceMiddleware ); wp.apiFetch.use( wp.apiFetch.mediaUploadMiddleware ); wp.apiFetch.nonceEndpoint = "https://bortec-tuning.de/wp-admin/admin-ajax.php?action=rest-nonce";</script>I have Autoptimize and Async JavaScript installed, but this particular snippet is the only one on that page that has no defer attribute attached and is not minimized. Why is this omitted by both plugins?
Now when i deactivate Autoptimize AND Async JavaScript, everything works fine. As soon as one of the two plugins is activated it does not work again (with other errors).
Thank you in advance!
The page I need help with: [log in to see the link]
The topic ‘Uncaught ReferenceError: wp is not defined’ is closed to new replies.