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

Html.Attributes.id "Elm" causes the page to stop loading. #491

Open
MartinSStewart opened this issue Oct 4, 2024 · 4 comments
Open

Html.Attributes.id "Elm" causes the page to stop loading. #491

MartinSStewart opened this issue Oct 4, 2024 · 4 comments

Comments

@MartinSStewart
Copy link

MartinSStewart commented Oct 4, 2024

Steps to reproduce:

  1. Check out this branch https://github.com/MartinSStewart/martins-homepage/tree/weird-bug
  2. Start npx elm-pages dev
  3. Open localhost:1234
  4. You should get this error in the console image

Note that this issue goes away if you go to the previous commit on the branch.

I'm on Windows, Firefox, and I can trigger this error both on Lamdera 1.3 and 1.2.2

@MartinSStewart
Copy link
Author

I've narrowed it down to this

view : App Data ActionData RouteParams -> Shared.Model -> Model -> View (PagesMsg Msg)
view app _ model =
    { title = ""
    , body = Ui.el [ Ui.id "Elm" ] Ui.none
    }

I think what is happening Html.Attribute.id "Elm" is causing some name collision.

@MartinSStewart MartinSStewart changed the title elm-pages dev stops working when I remove an if expression Html.Attributes.id "Elm" causes the page to stop loading. Oct 4, 2024
@MartinSStewart
Copy link
Author

MartinSStewart commented Oct 4, 2024

I've converted Index.elm into a SSCCE for this issue. It's the latest commit on https://github.com/MartinSStewart/martins-homepage/tree/weird-bug

@dillonkearns
Copy link
Owner

Thanks for the issue and SSCCE! I was trying to look through the codebase for anything that references an "elm" or "Elm" HTML id, but couldn't find it 🤔

I also notice that the elm-pages docs site, for example, doesn't have any elements with the ID "elm" or "Elm".

elm-pages - a statically typed site generator 2024-10-07 at 2 28 13 PM

So I'm pretty confused at why this would cause a problem.

@MartinSStewart
Copy link
Author

MartinSStewart commented Oct 9, 2024

The generated JS module name usually is called Elm right? Maybe that can somehow have a name collision with DOM ids?

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

2 participants