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.

Element docs and demos not registered due to external script reference

See original GitHub issue

I recently published a collection of 10 elements. The elements were all published but docs and demos were not registered for elements in the “Repository contents” panel in the right side bar. Docs for behaviors registered (e.g. fs-behavior) but not for elements (e.g. fs-signin).

I tracked the issue down to fs-client (which all elements depend on) referencing an external script via a CDN.

The src in master uses the protocol relative URL. Adding https:// removes the error from the CLI output but hydrolysis still fails. Adding a debug statement for the error reveals:

Error: no resolver found for https://unpkg.com/fs-js-lite@2.0.0/dist/FamilySearch.min.js
    at FileLoader.request (/home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/loader/file-loader.js:70:37)
    at Analyzer._processScript (/home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/analyzer.js:378:36)
    at /home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/analyzer.js:301:44
    at Array.forEach (native)
    at Analyzer._processScripts (/home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/analyzer.js:300:21)
    at Analyzer._parseHTML (/home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/analyzer.js:161:39)
    at null._onTimeout (/home/ubuntu/workspace/beta/analysis/node_modules/hydrolysis/lib/analyzer.js:125:39)
    at Timer.listOnTimeout (timers.js:92:15)

I’ll try installing the script via bower. Any other tips?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
would-code-againcommented, Dec 21, 2016

Pushed successfully and reanalyzed fs-client. <fs-client> is now in the repo contents.

0reactions
would-code-againcommented, Dec 21, 2016

https://custom-elements-staging.appspot.com/element/fs-webcomponents/fs-client/fs-client seems legit. Other elements are unaffected. Will push to prod.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: is null (External javascript) - Stack Overflow
When you call your javascript file at the header, your script searches element before being loaded. That's why it gives error. Try this...
Read more >
Including JavaScript In Your Page
Here's a very simple demonstration of how to include an external JavaScript file into an HTML page. Basic JavaScript Example. Other People's JavaScript....
Read more >
How To Access Elements in the DOM - DigitalOcean
Here is a table overview of the five methods we will cover in this tutorial. Gets, Selector Syntax, Method. ID, #demo, getElementById(). Class ......
Read more >
Call JavaScript functions from .NET methods in ASP.NET Core ...
Learn how to invoke JavaScript functions from .NET methods in Blazor apps.
Read more >
Remove Render-Blocking JavaScript | PageSpeed Insights
This rule triggers when PageSpeed Insights detects that your HTML references a blocking external JavaScript file in the above-the-fold portion ...
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