When I tried to include the stripe dependency only for the template where I need it (in laravel blade):
@push ('head_scripts')
<script src="https://js.stripe.com/v3/"></script>
@endpush
..I got the error 'ReferenceError: Stripe is not defined
'. So I included it in my main "head" partial, so it was included everywhere. Then I ran into the same error when going into the admin section, because it's not included in that template.
But does it really need to be included everywhere?
It is only used in one vue component like this:
<script>
let stripe = Stripe(`pk_test_zzzzzzzzzzzzzzz`);
let elements = stripe.elements();
let card = undefined;
This component seems to be evaluated even when it isn't rendered. Can I get around this issue in some way?