Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: domNode.replaceData is not a function #148

Open
nikoudel opened this issue Nov 21, 2018 · 7 comments
Open

Uncaught TypeError: domNode.replaceData is not a function #148

nikoudel opened this issue Nov 21, 2018 · 7 comments

Comments

@nikoudel
Copy link

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?

@bitfella
Copy link

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.

@nikoudel
Copy link
Author

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...

@bitfella
Copy link

bitfella commented Nov 21, 2018

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!

@nikoudel
Copy link
Author

nikoudel commented Nov 21, 2018

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
Copy link
Author

nikoudel commented Nov 22, 2018

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.

@Natim
Copy link

Natim commented Mar 8, 2019

Apparently Grammarly does that on Chrome as well

@kubukoz
Copy link

kubukoz commented Nov 19, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants