Munter / netlify-plugin-checklinks

Netlify build plugin check your links and asset references
BSD 3-Clause "New" or "Revised" License
89 stars 9 forks source link

svg images breaking the build: "text data outside of root node." #369

Closed dndao closed 2 years ago

dndao commented 3 years ago

This svg breaks the build `<?xml version="1.0" encoding="UTF-8"?>

Transparent background Created with Sketch. ` Log: `3:17:51 PM: ...........×.×...×.......................................×....×.............. 3:17:51 PM: ✖ FAIL Failed loading public/images/logo.svg 3:17:51 PM: | operator: error 3:17:51 PM: | actual: public/images/logo.svg: file:///opt/build/repo/public/images/logo.svg:1:1: text data outside of root node. 3:17:51 PM: | at: public/index.html:1:3039 CD Salus - Empowering people to take control of their health through technology 3:17:51 PM: ✖ FAIL Failed loading public/images/logo-mobile.svg 3:17:51 PM: | operator: error 3:17:51 PM: | actual: public/images/logo-mobile.svg: file:///opt/build/repo/public/images/logo-mobile.svg:1:1: text data outside of root node. 3:17:51 PM: | at: public/index.html:1:3225 CD Salus - Empowering people to take control of their health through technology 3:17:51 PM: ✖ FAIL Failed loading public/images/people-under-protection.svg 3:17:51 PM: | operator: error 3:17:51 PM: | actual: public/images/people-under-protection.svg: file:///opt/build/repo/public/images/people-under-protection.svg:1:1: text data outside of root node. 3:17:51 PM: | at: public/index.html:6:530 Home 3:17:51 PM: ✖ FAIL Failed loading public/images/our-team-working.svg 3:17:51 PM: | operator: error 3:17:51 PM: | actual: public/images/our-team-working.svg: file:///opt/build/repo/public/images/our-team-working.svg:1:1: text data outside of root node. 3:17:51 PM: | at: public/team/index.html:6:567 3:17:51 PM: ✖ FAIL Failed loading public/images/happy-people.svg 3:17:51 PM: | operator: error 3:17:51 PM: | actual: public/images/happy-people.svg: file:///opt/build/repo/public/images/happy-people.svg:1:1: text data outside of root node. 3:17:51 PM: | at: public/services/index.html:6:865 3:17:51 PM: 77 tests 3:17:51 PM: 72 passed 3:17:51 PM: 5 failed`
Munter commented 3 years ago

I tried copy/pasting your svg code and ran hyperlink on it without any parsing errors. Could you link me to a raw file that is already on the internet, which exhibits this problem? I have a feeling you might have an invisible character before your XML declaration, like a BOM or something similar

dndao commented 3 years ago

Hi Munter, thank you for a quick response!

This file is one of the ones that broke the build.

I checked for hidden characters as well but couldn't find any. Please let me know if that's the problem, thank you!

Munter commented 3 years ago

I can't reproduce the error. This is what I get when I run hyperlink on your dev deployment:

$ hyperlink -ri https://dev--cdsalus.netlify.app/
Guessing --root from input files: https://dev--cdsalus.netlify.app/
TAP version 13
# Crawling internal assets
ok 1 load https://dev--cdsalus.netlify.app/
ok 2 load https://dev--cdsalus.netlify.app
ok 3 load https://kit.fontawesome.com/7c7debe2f8.js
ok 4 load https://dev--cdsalus.netlify.app/favicon/site.webmanifest
ok 5 load https://www.googletagmanager.com/gtag/js?id=UA-176578744-1
ok 6 load https://dev--cdsalus.netlify.app/contact/
ok 7 load https://dev--cdsalus.netlify.app/contact
ok 8 load https://dev--cdsalus.netlify.app/guides
ok 9 load https://dev--cdsalus.netlify.app/team/
ok 10 load https://dev--cdsalus.netlify.app/mission/
ok 11 load https://dev--cdsalus.netlify.app/guides/
ok 12 load https://dev--cdsalus.netlify.app/images/logo-mobile.svg
ok 13 load https://dev--cdsalus.netlify.app/js/app.min.ad590c524b7e12aa71a0dc7a702a9a44b775fadcaffc80dfd5ed264960d3836c.min.ad590c524b7e12aa71a0dc7a702a9a44b775fadcaffc80dfd5ed264960d3836c.js
ok 14 load https://cdsalus.com
ok 15 load https://dev--cdsalus.netlify.app/images/logo.svg
ok 16 load https://dev--cdsalus.netlify.app/services/
ok 17 load https://dev--cdsalus.netlify.app/privacy/
ok 18 load https://dev--cdsalus.netlify.app/terms-of-use/
ok 19 load https://dev--cdsalus.netlify.app/images/people-under-protection.svg
ok 20 load https://dev--cdsalus.netlify.app/guides/exercise/test-5/
ok 21 load https://dev--cdsalus.netlify.app/guides/restful-sleep/test-5/
ok 22 load https://dev--cdsalus.netlify.app/guides/mental-wellness/test-5/
ok 23 load https://dev--cdsalus.netlify.app/css/style.min.94ad25f58e253444ab04e3a95209def8f85775188183ea7383c75de144946d76.css
ok 24 load https://www.google.com/recaptcha/api.js
ok 25 load https://maps.googleapis.com/maps/api/js?key=AIzaSyAZdvzXOf5fYCMcoshkCgMikttcFwSNDpA&callback=initMap
ok 26 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-5/
ok 27 load https://dev--cdsalus.netlify.app/guides/page/9/
ok 28 load https://dev--cdsalus.netlify.app/tags/home-health
ok 29 load https://dev--cdsalus.netlify.app/guides/page/5/
ok 30 load https://dev--cdsalus.netlify.app/guides/exercise
ok 31 load https://dev--cdsalus.netlify.app/services/safety-security/
ok 32 load https://dev--cdsalus.netlify.app/services/mental-stimulation/
ok 33 load https://dev--cdsalus.netlify.app/guides/page/4/
ok 34 load https://dev--cdsalus.netlify.app/services/health-wellness/
ok 35 load https://dev--cdsalus.netlify.app/guides/page/2/
ok 36 load https://dev--cdsalus.netlify.app/guides/aging-at-home/home-based-aged-care/
ok 37 load https://dev--cdsalus.netlify.app/images/our-team-working.svg
ok 38 load https://dev--cdsalus.netlify.app/services/independence/
ok 39 load https://dev--cdsalus.netlify.app/guides/page/3/
ok 40 load https://dev--cdsalus.netlify.app/images/happy-people.svg
ok 41 load https://dev--cdsalus.netlify.app/services/medical-conditions/
ok 42 load https://dev--cdsalus.netlify.app/services/social-connectivity/
ok 43 load https://dev--cdsalus.netlify.app/guides/mental-wellness
ok 44 load https://dev--cdsalus.netlify.app/guides/restful-sleep
ok 45 load https://dev--cdsalus.netlify.app/tags/chsp
ok 46 load https://dev--cdsalus.netlify.app/icons/arrow-for-links.svg
ok 47 load https://dev--cdsalus.netlify.app/guides/restful-sleep/test-1/
ok 48 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition
ok 49 load https://dev--cdsalus.netlify.app/guides/restful-sleep/
ok 50 load https://dev--cdsalus.netlify.app/tags/innovative
ok 51 load https://dev--cdsalus.netlify.app/guides/page/8/
ok 52 load https://dev--cdsalus.netlify.app/guides/restful-sleep/page/2/
ok 53 load https://dev--cdsalus.netlify.app/guides/mental-wellness/
ok 54 load https://dev--cdsalus.netlify.app/tags/aged-care
ok 55 load https://dev--cdsalus.netlify.app/guides/exercise/test-4/
ok 56 load https://dev--cdsalus.netlify.app/guides/mental-wellness/page/2/
ok 57 load https://dev--cdsalus.netlify.app/guides/exercise/
ok 58 load https://dev--cdsalus.netlify.app/guides/exercise/test-2/
ok 59 load https://dev--cdsalus.netlify.app/guides/restful-sleep/test-2/
ok 60 load https://dev--cdsalus.netlify.app/tags/requirements
ok 61 load https://dev--cdsalus.netlify.app/tags/chsp/
ok 62 load https://dev--cdsalus.netlify.app/guides/mental-wellness/test-2/
ok 63 load https://dev--cdsalus.netlify.app/tags/innovative/
ok 64 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-3/
ok 65 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/
ok 66 load https://dev--cdsalus.netlify.app/tags/pension
ok 67 load https://dev--cdsalus.netlify.app/tags/aging
ok 68 load https://dev--cdsalus.netlify.app/guides/aging-at-home/seniors-are-taking-up-it-in-droves/
ok 69 load https://dev--cdsalus.netlify.app/tags/aged-care/
ok 70 load https://dev--cdsalus.netlify.app/guides/mental-wellness/test-3/
ok 71 load https://dev--cdsalus.netlify.app/tags/home-health/
ok 72 load https://dev--cdsalus.netlify.app/guides/aging-at-home/australia-an-aging-nation/
ok 73 load https://dev--cdsalus.netlify.app/guides/exercise/test-3/
ok 74 load https://dev--cdsalus.netlify.app/tags/australian
ok 75 load https://dev--cdsalus.netlify.app/tags/senior-australian
not ok 76 load https://dev--cdsalus.netlify.app/tags/aged%20care
  ---
    operator: load
    expected: "200 https://dev--cdsalus.netlify.app/tags/aged%20care"
    actual:   "HTTP 404 Not Found"
    at: https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-3/ (11:5005) <a class="post-tags" href="/tags/aged%20care">...</a>
  ...
ok 77 load https://dev--cdsalus.netlify.app/guides/mental-wellness/test-1/
ok 78 load https://dev--cdsalus.netlify.app/tags/it
ok 79 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/page/2/
ok 80 load https://dev--cdsalus.netlify.app/guides/exercise/test-1/
ok 81 load https://dev--cdsalus.netlify.app/tags/senior
ok 82 load https://dev--cdsalus.netlify.app/tags/iot
ok 83 load https://dev--cdsalus.netlify.app/tags/internet-of-things
ok 84 load https://dev--cdsalus.netlify.app/tags/pension/
ok 85 load https://dev--cdsalus.netlify.app/tags/aging/
ok 86 load https://dev--cdsalus.netlify.app/tags/australians
ok 87 load https://dev--cdsalus.netlify.app/tags/requirements/
ok 88 load https://dev--cdsalus.netlify.app/guides/exercise/page/2/
ok 89 load https://dev--cdsalus.netlify.app/tags/senior/
ok 90 load https://dev--cdsalus.netlify.app/tags/australian/
ok 91 load https://dev--cdsalus.netlify.app/tags/it/
ok 92 load https://dev--cdsalus.netlify.app/tags/australians/
not ok 93 load https://dev--cdsalus.netlify.app/tags/home%20care
  ---
    operator: load
    expected: "200 https://dev--cdsalus.netlify.app/tags/home%20care"
    actual:   "HTTP 404 Not Found"
    at: https://dev--cdsalus.netlify.app/guides/exercise/test-2/ (13:25) <a class="post-tags" href="/tags/home%20care">...</a>
  ...
ok 94 load https://dev--cdsalus.netlify.app/tags/iot/
ok 95 load https://dev--cdsalus.netlify.app/tags/senior-australian/
ok 96 load https://dev--cdsalus.netlify.app/tags/internet-of-things/
ok 97 load https://dev--cdsalus.netlify.app/guides/restful-sleep/test-3/
ok 98 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-1/
ok 99 load https://dev--cdsalus.netlify.app/guides/restful-sleep/test-4/
ok 100 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-4/
ok 101 load https://dev--cdsalus.netlify.app/guides/mental-wellness/test-4/
ok 102 load https://dev--cdsalus.netlify.app/guides/page/7/
ok 103 load https://dev--cdsalus.netlify.app/guides/diet-and-nutrition/test-2/
ok 104 load https://dev--cdsalus.netlify.app/guides/aging-at-home/thanks-to-affordable-and-reliable-inhome-caregiver-service-plus-technology-life-is-much-brighter/
ok 105 load https://dev--cdsalus.netlify.app/guides/page/6/
ok 106 load https://dev--cdsalus.netlify.app/guides/aging-at-home/information-technology-for-elderly-people/
ok 107 load https://dev--cdsalus.netlify.app/guides/aging-at-home
ok 108 load https://dev--cdsalus.netlify.app/guides/aging-at-home/
ok 109 load https://dev--cdsalus.netlify.app/guides/aging-at-home/page/2/
# Connecting to 0 hosts (checking <link rel="preconnect" href="...">
# Looking up 0 host names (checking <link rel="dns-prefetch" href="...">

1..109
# tests 109
# pass  107
# fail  2
dndao commented 3 years ago

Hmm, strange. Does this mean you try the plugins with my dev branch because I had to remove the plugin earlier.