I noticed that I was getting 404s by Paddle on a staging environment. The 404s were on the product domain and caused by the fact that certain plan IDs could not be found.
I double checked the HTML to see if the environment was set correctly. Apparently the code for setting the environment to Sandbox environment was present. However, when running Paddle.Environment.get() in the console, it would return production as environment.
I was able to pinpoint the issue to Livewire and the fact that Livewire v3 now introduces __BLOCK__ comments in HTML around Blade @if's:
Since the if-condition was inside a <script> tag, JavaScript doesn't know how to handle this comment well, and therefore the environment would never be set to sandbox. This PR solves the Livewire compatibility by putting the Environment set call in a separate script tag.
I noticed that I was getting 404s by Paddle on a staging environment. The 404s were on the product domain and caused by the fact that certain plan IDs could not be found.
I double checked the HTML to see if the environment was set correctly. Apparently the code for setting the environment to Sandbox environment was present. However, when running
Paddle.Environment.get()
in the console, it would returnproduction
as environment.I was able to pinpoint the issue to Livewire and the fact that Livewire v3 now introduces
__BLOCK__
comments in HTML around Blade@if
's:Since the if-condition was inside a
<script>
tag, JavaScript doesn't know how to handle this comment well, and therefore the environment would never be set to sandbox. This PR solves the Livewire compatibility by putting the Environment set call in a separate script tag.Thanks!