Adyen / adyen-shopware6

Adyen Payment plugin for Shopware 6
MIT License
21 stars 22 forks source link

Js error on Symfony Prod mode because of moved inline JS #538

Open Gugiman opened 2 months ago

Gugiman commented 2 months ago

Describe the bug If you change from dev to Production mode in .env, the inline JS moved to the head of the DOM. This symfony default behaviour: https://symfony.com/blog/moving-script-inside-head-and-the-defer-attribute#the-caveat-inline-javascript-cannot-be-deferred

Therefore no customer can checkout correctly.

Versions Shopware version: 6.5.8.13 Plugin version: 3.15.0

To Reproduce Steps to reproduce the behavior:

  1. Setup a running Adyen implementation with Paypal and credit card in Shopware dev mode
  2. Verify that the Credit Card Field are loaded on checkout/confirm
  3. Switch from dev to prod in .env and clear all caches
  4. Reload Page and see a js console error because document.querySelector('#adyen-checkout-options').dataset is called and executed in the head before the <div id="adyen-checkout-options"> exists.

Expected behavior Inline JS should be called after the DOM is completely rendered by the Browser or the Githubissues.

  • Githubissues is a development platform for aggregating issues.