8000 Turbolinks complain about loading from <body>, while script is not in <body> · Issue #607 · turbolinks/turbolinks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Sep 25, 2021. It is now read-only.
This repository was archived by the owner on Sep 25, 2021. It is now read-only.
Turbolinks complain about loading from <body>, while script is not in <body> #607
Open
@adaamz

Description

@adaamz

Describe the bug

turbolinks.js:6 You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!

Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.

For more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements

——
Suppress this warning by adding a `data-turbolinks-suppress-warning` attribute to: <script type="text/javascript" src="/static/js/compiled_ts.js" data-turbolinks-eval="false"></script>

To Reproduce
A minimal demonstration of the issue can be really helpful, and will speed up our response time. Try remixing the Turbolinks demo on Glitch: https://turbolinks-demo.glitch.me/

Steps to reproduce the behavior:

  1. place turbolinks initialization script after
  2. load page
  3. see warning

Expected behavior
No warning

Details:

  • Operating System: Windows 10
  • Browser: Opera 74.0, Firefox 78.7, Chrome 89.0
  • Turbolinks Version: 5.2.0

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0