Open timgavin opened 4 years ago
I followed the installation instructions but I continue to receive the js error
can't find variable: swal
... try { window.Popper = require('popper.js').default; window.$ = window.jQuery = require('jquery'); require('bootstrap'); require('sweetalert'); } catch (e) {} ...
require('./bootstrap'); $( document ).ready(function() { $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); });
... @include('sweet::alert') </body>
Then I run npm run prod
npm run prod
The only way I can get it to work is if I use the CDN....
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
In your bootstrap.js, try adding this to your try catch block:
const swal = require('sweetalert');
I followed the installation instructions but I continue to receive the js error
bootstrap.js
app.js
app.blade
Then I run
npm run prod
The only way I can get it to work is if I use the CDN....