Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      June 2025: All AI updates from the past month

      June 30, 2025

      Building a culture that will drive platform engineering success

      June 30, 2025

      Gartner: More than 40% of agentic AI projects will be canceled in the next few years

      June 30, 2025

      Never Stop Exploring (July 2025 Wallpapers Edition)

      June 30, 2025

      I never thought I’d praise a kickstand power bank – until I tried this one

      June 30, 2025

      I replaced my work PC with this Alienware laptop – now I’m wondering why I hadn’t done this sooner

      June 30, 2025

      How to set up Alexa to receive notifications on Prime Day deals you want

      June 30, 2025

      How proxy servers actually work, and why they’re so valuable

      June 30, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Top 6 MySQL Database Management Struggles for Laravel Developers (And Smart Fixes)

      June 30, 2025
      Recent

      Top 6 MySQL Database Management Struggles for Laravel Developers (And Smart Fixes)

      June 30, 2025

      What’s the difference between named functions and arrow functions in JavaScript?

      June 30, 2025

      Spring Boot + Swagger: A Complete Guide to API Documentation

      June 30, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Relive the Golden Era: 5 Tools to Get Retro Feel on Linux

      June 30, 2025
      Recent

      Relive the Golden Era: 5 Tools to Get Retro Feel on Linux

      June 30, 2025

      mpvc – mpc-like CLI tool for mpv

      June 30, 2025

      sherpa-onnx is speech-to-text and text-to-speech software

      June 30, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»This Isn’t Supposed to Happen: Troubleshooting the Impossible

    This Isn’t Supposed to Happen: Troubleshooting the Impossible

    May 14, 2025

    I recently rebuilt my portfolio (johnrhea.com). After days and days of troubleshooting and fixing little problems on my local laptop, I uploaded my shiny new portfolio to the server — and triumphantly watched it not work at all…

    The browser parses and runs JavaScript, right? Maybe Chrome will handle something a little different from Firefox, but if the same code is on two different servers it should work the same in Chrome (or Firefox) no matter which server you look at, right? Right?

    First, the dynamically generated stars wouldn’t appear and when you tried to play the game mode, it was just blank. No really terrible website enemies appeared, nor could they shoot any bad experience missiles at you, at least, not in the game mode, but I guess my buggy website literally sent a bad experience missile at you. Over on the page showing my work, little cars were supposed to zoom down the street, but they didn’t show up, either.

    Let me tell you, there was no crying or tears of any kind. I was very strong and thrilled, just thrilled, to accept the challenge of figuring out what was going on. I frantically googled things like “What could cause JavaScript to act differently on two servers?”, “Why would a server change how JavaScript works?”, and “Why does everyone think I’m crying when I’m clearly not?” But to no avail.

    There were some errors in the console, but not ones that made sense. I had an SVG element that we’ll call car (because that’s what I named it). I created it in vanilla JavaScript, added it to the page, and zoomed it down the gray strip approximating a street. (It’s a space theme where you can explore planets. It’s really cool. I swear.) I was setting transforms on car using car.style.transform and it was erroring out. car.style was undefined.

    Uncaught TypeError: Cannot set properties of undefined.

    I went back to my code on my laptop. Executes flawlessly. No errors.

    To get past the initial error, I switched it from car.style to using setAttribute e.g. car.setAttribute('style', 'transform: translate(100px, 200px)');. This just got me to the next error. car was erroring out on some data-* attributes I was using to hold information about the car, e.g. car.dataset.xspeed would also come back undefined when I tried to access them. This latter technology has been supported in SVG elements since 2015, yet it was not working on the server, and worked fine locally. What the Hoobastank could be happening? (Yes, I’m referencing the 1990s band and, no, they have nothing to do with the issue. I just like saying… errr… writing… their name.)

    With search engines not being much help (mostly because the problem isn’t supposed to exist), I contacted my host thinking maybe some kind of server configuration was the issue. The very polite tech tried to help, checking for server errors and other simple misconfigurations, but there were no issues he could find. After reluctantly serving as my coding therapist and listening to my (tearless) bemoaning of ever starting a career in web development, he basically said they support JavaScript, but can’t really go into custom code, so best of luck. Well, thanks for nothing, person whom I will call Truckson! (That’s not his real name, but I thought “Carson” was too on the nose.)

    Next, and still without tears, I tried to explain my troubles to ChatGPT with the initial prompt: “Why would JavaScript on two different web servers act differently?” It was actually kind of helpful with a bunch of answers that turned out to be very wrong.

    • Maybe there was an inline SVG vs SVG in an img issue? That wasn’t it.
    • Could the browser be interpreting the page as plain text instead of HTML through some misconfiguration? Nope, it was pulling down HTML, and the headers were correct.
    • Maybe the browser is in quirks mode? It wasn’t.
    • Could the SVG element be created incorrectly? You can’t create an SVG element in HTML using document.createElement('svg') because SVG actually has a different namespace. Instead, you have to use document.createElementNS("http://www.w3.org/2000/svg", 'svg'); because SVG and HTML use similar, but very different, standards. Nope, I’d used the createElementNS function and the correct namespace.

    Sidenote: At several points during the chat session, ChatGPT started replies with, “Ah, now we’re getting spicy 🔥” as well as, “Ah, this is a juicy one. 🍇” (emojis included). It also used the word “bulletproof” a few times in what felt like a tech-bro kind of way. Plus there was a “BOOM. 💥 That’s the smoking gun right there”, as well as an “Ahhh okay, sounds like there’s still a small gremlin in the works.” I can’t decide whether I find this awesome, annoying, horrible, or scary. Maybe all four?

    Next, desperate, I gave our current/future robot overlord some of my code to give it context and show it that none of these were the issue. It still harped on the misconfiguration and kept having me output things to check if the car element was an SVG element. Again, locally it was an SVG element, but on the server it came back that it wasn’t.

    • Maybe using innerHTML to add some SVG elements to the car element garbled the car element into not being an SVG element? ChatGPT volunteered to rewrite a portion of code to fix this. I put the new code into my system. It worked locally! Then I uploaded it to the server and… no dice. Same error was still happening.

    I wept openly. I mean… I swallowed my emotions in a totally healthy and very manly way. And that’s the end of the article, no redemption, no solution, no answer. Just a broken website and the loud sobs of a man who doesn’t cry… ever…

    …You still here?

    Okay, you’re right. You know I wouldn’t leave you hanging like that. After the non-existent sob session, I complained to ChatGPT, it again gave me some console logs including having the car element print out its namespace and that’s when the answer came to me. You see the namespace for an SVG is this:

    http://www.w3.org/2000/svg

    What it actually printed was this:

    https://www.w3.org/2000/svg

    One letter. That’s the difference.

    Normally you want everything to be secure, but that’s not really how namespaces work. And while the differences between these two strings is minimal, I might as well have written document.createElementNS("Gimme-them-SVGzers", "svg");. Hey, W3C, can I be on the namespace committee?

    But why was it different? You’d be really mad if you read this far and it was just a typo in my code. Right?

    You’ve invested some time into this article, and I already did the fake-out of having no answer. So, having a code typo would probably lead to riots in the streets and hoards of bad reviews.

    Don’t worry. The namespace was correct in my code, so where was that errant “s” coming from?

    I remembered turning on a feature in my host’s optimization plugin: automatically fix insecure pages. It goes through and changes insecure links to secure ones. In 99% of cases, it’s the right choice. But apparently it also changes namespace URLs in JavaScript code.

    I turned that feature off and suddenly I was traversing the galaxy, exploring planets with cars zooming down gray pseudo-elements, and firing lasers at really terrible websites instead of having a really terrible website. There were no tears (joyful or otherwise) nor were there celebratory and wildly embarrassing dance moves that followed.

    Have a similar crazy troubleshooting issue? Have you solved an impossible problem? Let me know in the comments.


    This Isn’t Supposed to Happen: Troubleshooting the Impossible originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleThis AI Paper Investigates Test-Time Scaling of English-Centric RLMs for Enhanced Multilingual Reasoning and Domain Generalization
    Next Article (non recensione) anteprima di Ufficio Zero Linux EDU

    Related Posts

    News & Updates

    I never thought I’d praise a kickstand power bank – until I tried this one

    June 30, 2025
    News & Updates

    I replaced my work PC with this Alienware laptop – now I’m wondering why I hadn’t done this sooner

    June 30, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-2501 – Lenovo PC Manager Privilege Escalation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Behavior-Driven Development (BDD) with Selenium and Cucumber

    Development

    CVE-2025-4842 – D-Link DCS-932L Stack-Based Buffer Overflow Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Le notizie minori del mondo GNU/Linux e dintorni della settimana nr 26/2025

    Linux

    Highlights

    UniTaskerPro

    April 30, 2025

    Post Content Source: Read More 

    OpenAI’s most impressive move has nothing to do with AI

    April 18, 2025

    Salesforce OmniStudio Flaws Expose Encrypted Data

    June 10, 2025

    CVE-2025-47704 – Drupal Klaro Cookie & Consent Management Cross-Site Scripting (XSS)

    May 14, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.