Skip to content

Track module's package to prevent Types module collision - #110

Open
Janiczek wants to merge 2 commits into
lamdera:lamdera-nextfrom
Janiczek:janiczek-track-module-info
Open

Track module's package to prevent Types module collision#110
Janiczek wants to merge 2 commits into
lamdera:lamdera-nextfrom
Janiczek:janiczek-track-module-info

Conversation

@Janiczek

Copy link
Copy Markdown
Collaborator

Quick Summary:

Relates to this Discord thread.

In my Lamdera app I'm using miyamoen/select-list which internally contains a Types module.

This wreaks havoc onto Lamdera's code, which uses ModuleName.Raw instead of ModuleName.Canonical and expects that the Types module name only means "the user's Types module", and this error can be seen:

-- WIRE ISSUES -----------------------------------------------------------------

I ran into the following problems when checking Lamdera core types:

FrontendModel:

- ❗️Failed to find either alias or custom type for type that seemingly must exist: SelectList` from miyamoen/select-list:Types. Please report this issue with your code!

SSCCE

  1. lamdera init
  2. lamdera install miyamoen/select-list
  3. update FrontendModel to contain a SelectList ()
  4. make the code compile (init)
  5. try to lamdera deploy -> get the above error.
  • Elm: 0.19.1
  • Browser: Chrome
  • Operating System: macOS

Additional Details

I don't like that the test depends on the select-list package having a specific internal module structure. If we can somehow hardcode things into the test fixture directory that would be nicer. IDK if it's possible or if Lamdera test suite has some helpers for that though.

@Janiczek
Janiczek requested a review from supermario August 20, 2026 15:46

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah dang, I forgot this PR doesn't only touch ext* but the original Elm source as well ... Should we somehow minimize the diff in these worker/* files? For example keep checkImports type signature as-is and then have just an one-line change where we call checkImports?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to touch the original Elm code at all?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, your comment led me to realize I can do this without those changes (=> without changing the artifact files)

Packages like miyamoen/select-list have their own internal `Types`
module. This doesn't play nice with Lamdera Wire logic which didn't take
the possibility into account and just tracked raw module names instead
of also the package that owns them.

The fix involves tracking ModuleName.Canonical instead of
ModuleName.Raw.
@Janiczek
Janiczek force-pushed the janiczek-track-module-info branch from ecf2f28 to 8ecdfc8 Compare August 21, 2026 16:13
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

Successfully merging this pull request may close these issues.

2 participants