laravel-view-xray icon indicating copy to clipboard operation
laravel-view-xray copied to clipboard

Just a tip for those having issues...

Open jayjfletcher opened this issue 6 years ago • 1 comments
trafficstars

Like many others here, I too had an issue where nothing would happen, but I could see the comments in the HTML. There was no error message, no "Ready to Xray. Press cmd+shift+x to scan your UI.".

Many may not know or even notice, but the loading of the default Laravel app.js (which includes jQuery) in layouts/app.blade.php is deferred.

Meaning the inline Xray script ends up being run before the app.js and exits because jQuery has not yet loaded.

Replacing <script src="{{ mix('js/app.js') }}" defer></script>

with

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

Or even

<script src="{{ mix('js/app.js') }}" {{env('APP_ENV') !== 'production' ? '' : 'defer'}}></script>

will fix the issue.

jayjfletcher avatar Feb 15 '19 16:02 jayjfletcher

Thank You!

tanthammar avatar Apr 12 '19 12:04 tanthammar