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.

inject inlinePrebootCode in HEAD? or immediately after appRoot

See original GitHub issue
  • I’m submitting a …
  • bug report
  • Which parts of preboot are affected by this issue?
  • server side
  • inline

According to the README:

You then inject inlinePrebootCode into the HEAD section of your server-side template.

But that doesn’t work, at least, in the following cases:

  • With Angular 2x auto bootstrap (using ng-app or data-ng-app attr on your app root), this inline script seems to only work at the very end of the <body> (presumably because Angular waits for DOM ready event before executing)
    • in other words, the waitUntilReady must not (even with setTimeout of 1) be getting executed fast enough
  • With Angular 4x, where Angular’s bootstrapModule code can happen before DOM ready event, then this inline script only works when immediately after the app root.

So I’m proposing, assuming someone can corroborate, that the guidance be changed to insert the “inlinePrebootCode” immediately after the app root element (so it works in most (all?) cases)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
jeffwhelpleycommented, Apr 11, 2017

Hi, @jotto. I will have a major refactor of preboot that will work better with v4 shortly. Stay tuned.

1reaction
jeffwhelpleycommented, May 16, 2017

@chrisnassouri sorry about the delay. work projects have been eating into my fun open source time 😉 I will get something out for this by next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

preboot - npm
Inline - This is the code that is injected into the HEAD of your server view and is in charge of recording all...
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