Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Michealm's avatar

issue with stripe API JS and laravel JS

ok so i recently have been trying to use the stripe API / cashier with laravel 5.4, i wanted to use the simple method with the popup, however every time i would put the code for the popup in my view and click the button it did not show the form just submitted, well after many many hours and many many google searches that turned up nothing, i figured this out!

the JS in the layouts/app view is the problem!!


<script src="{{ asset('js/app.js') }}"></script>

as soon as this is commented out the popup that is JS from stripe worked as intended, not sure if anyone else has had this issue but im putting it here for that and to also hopefully let someone of importance know so they can look into this and see if there is a permanent fix for laravel

0 likes
10 replies
topvillas's avatar

Nobody will be able to figure anything out if all you're going to post is a script tag.

Michealm's avatar

anyone can open there laravel 5.4 and see the app.js JS file, it comes with laravel. its a huge file i really doubt it should be posted

Michealm's avatar

that must be the difference im using the simple method which is just loading the script with data tags, i dont know JS enough to do it the custom way, though i plan on checking out vue eventually, that script is not very important anyhow but i figured i would bring it up somewhere so others would be able to see.

Gianni3g's avatar

I have the same problem, how did you fix that?

Michealm's avatar

Just remove the declaration of that script and its all good, if you use your own master blade file and not the default then that script will not be there.

chriss39's avatar

I noticed if you just comment out the vue registration in app.js it will work. You can leave it to load everything in bootstrap.js. I am sure there is a simple fix but I am not sure what it is.

proxomos's avatar

There might be a better solution but this worked for me:

I added the following just above the script for Vue.js in public/js/app.js

new Vue({ delimiters: ['${', '}'] })

xparthxvorax's avatar

@Michealm,

I am having the same issue and I have also spent a lot of hours on this issue. FInally, I know that the default app.js is making the issue with Stripe's checkout.js. But what is the solution here? I do want to use that default app.js. So any other solution except removing that js?

Thanks

skoobi's avatar

Im getting the same issue. Spent hours trying to figure out what was causing stripes subscription error "This customer has no attached payment source". Then figured out that it was Vue spitting out this error:

[Vue warn]: Error compiling template:
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

I think i need to make a specific vue component for stripe but yet to figure it out for subscriptions but there is this one for vue payments:

https://www.npmjs.com/package/vue-stripe

Please or to participate in this conversation.