question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedded Scripts are activated on some environments and not on others

See original GitHub issue

Relates to #186.

But on another colleagues PC the <script> Tags get executed while loading, so the workaround results in having them executed twice. It was testet in Firefox and Chrome and the same behavior in both Browsers.

What could be the reason for that? And is there a way to avoid the double execution?

I try to catch all executions with the afterscriptexecute Event of the document but I guess I’m too late when the workaround controller (from @xtr3me). Any Ideas what could cause that?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
xtr3mecommented, Apr 1, 2021

Yes, that is the goal @JulianFeinauer 👍

0reactions
redrosscommented, Oct 25, 2021

Am I mistaken or the issue should already be resolved? I’m using turbo-rails (7.1.1) and I’m still getting an issue with javascript not getting executed:

= turbo_frame_tag 'open_rate', src: some_path(@record) do
  %p Loading open stats..

basic HTML gets loaded, but the JS is not run (the chart appears if I manually run the JS):

# The file that gets loaded:
= turbo_frame_tag :open_rate do
    %h2 Open rate
    = line_chart [{ name: 'OpenRate', data:  data}], legend: nil, min: 0, max: [(data.values.max * 2).floor, 100].min

Or is this not support to work without adding Stimulus?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Evaluate script tags from turbo streams · Issue #186 - GitHub
It seems that <script> tags in turbostream templates are not evaluated (at least not when appending). Is this a bug, or expected behaviour?...
Read more >
Troubleshoot and Test EEM Scripts - Cisco
This document provides useful information on how to test and verify EEM with CLI show commands, and also explains some common failure scenarios ......
Read more >
Error with embedding javascript form (Active Campaign) on .NET
I'm trying to embed a 'simple embed' javascript form from Active Campaign on a .NET environment (custom CMS I think). I got several...
Read more >
<iframe>: The Inline Frame element - HTML - MDN Web Docs
The <iframe> HTML element represents a nested browsing context, embedding another HTML page into the current one.
Read more >
Environments and deployments - GitLab Docs
Some variables cannot be used as environment names or URLs. ... In this case, you don't know the URL before the deployment script...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found