virtual-dom icon indicating copy to clipboard operation
virtual-dom copied to clipboard

Uncaught TypeError: domNode.replaceData is not a function

Open nikoudel opened this issue 6 years ago • 7 comments

Hi! I'm having an issue which might belong here.

image

First, the app fails to render correctly - it's supposed to be like this:

image

Second, the app goes into an infinite loop when I click any of the links (the console errors).

This happens with a fresh Elm 0.19 install and the code from the example app on this guide page.

elm.json looks like this:

{
    "type": "application",
    "source-directories": [
        "src"
    ],
    "elm-version": "0.19.0",
    "dependencies": {
        "direct": {
            "elm/browser": "1.0.1",
            "elm/core": "1.0.2",
            "elm/html": "1.0.0",
            "elm/url": "1.0.0"
        },
        "indirect": {
            "elm/json": "1.1.2",
            "elm/time": "1.0.0",
            "elm/virtual-dom": "1.0.2"
        }
    },
    "test-dependencies": {
        "direct": {},
        "indirect": {}
    }
}

Note: the problem only appears in a certain Google Chrome instance (but not in IE or Firfox). Also the app works correctly when I run it in incognito mode in the same Chrome instance. And also it runs fine in another computer with the same Google Chrome version (70.0.3538.110) and the same addons. Disabling the addons doesn't help. Any ideas?

nikoudel avatar Nov 21 '18 10:11 nikoudel

Hi there. Do you have JSON Viewer Chrome extension installed? In my case that's what causes the issue. Disabled it and everything works just fine.

bitfella avatar Nov 21 '18 16:11 bitfella

You are right! Disabling that extension helped. Didn't notice I had that extension installed on my main PC but not on the other.

I don't know though should I close this ticket or not... it would be kinda lame to tell app users to disable their extensions so they could use my site...

nikoudel avatar Nov 21 '18 17:11 nikoudel

I suppose you are using Elm Reactor to generate that code, as suggested in the docs. You should then generate production code with Elm Make and minify it. I guess production-ready code should not be affected by the kind of issue you opened. Give it a try!

bitfella avatar Nov 21 '18 18:11 bitfella

Nope, that didn't work. I used uglifyjs as described here and updated the html file to load the minified version but enabling the JSON Viewer extension still breaks it.

edit: I'm not using Elm Reactor btw.

nikoudel avatar Nov 21 '18 20:11 nikoudel

This issue is most likely caused by this bug in JSON Viewer.

A workaround is avoiding raw text without enclosing html elements, i.e. using span [] [ text "The current URL is: " ] instead of text "The current URL is: ".

Leaving for others to decide whether the Uncaught TypeError and the infinite loop thing can/should be still prevented in Elm.

nikoudel avatar Nov 22 '18 10:11 nikoudel

Apparently Grammarly does that on Chrome as well

Natim avatar Mar 08 '19 16:03 Natim

Dark Reader too. There goes a few hours of work... image

kubukoz avatar Nov 19 '19 17:11 kubukoz