Element docs and demos not registered due to external script reference
See original GitHub issueI 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:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pushed successfully and reanalyzed fs-client. <fs-client> is now in the repo contents.
https://custom-elements-staging.appspot.com/element/fs-webcomponents/fs-client/fs-client seems legit. Other elements are unaffected. Will push to prod.