Closed fffx closed 3 years ago
Is your <script>
tag located in the <head>
of your document? window.Turbo
must be available immediately on page load.
Yes, the <script>
is definitely located in the <head>
of my document. The reason may be caused by type="module-shim"
is async loading
When I use module-shim to export Turbo to global scope, everything works fine in the native browser
but in Turbo android, I will get to the error page sometimes when I trigger a pull refresh, the log says TurboIsReady is false, but if I keep refreshing, it will come back, and then error, come back, error, go on and go on.
Though I have fixed this by download https://unpkg.com/browse/@hotwired/turbo@7.0.0-beta.4/dist/turbo.es2017-umd.js, and include it by
javascript_include_tag 'turbo.es2017-umd'
, I still wanna to know why this happens.