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

Nested module names aren't supported #218

Closed
lukewestby opened this issue Jan 22, 2017 · 0 comments
Closed

Nested module names aren't supported #218

lukewestby opened this issue Jan 22, 2017 · 0 comments

Comments

@lukewestby
Copy link
Collaborator

lukewestby commented Jan 22, 2017

Currently one can customize the module name used by elm-css with the --module=Whatever option. The value passed in is used as a single string and a check is performed to look up the module name on the top-level Elm object:

var worker = Elm[stylesheetsModule].worker();

This means that any module name with nested qualifiers will fail. For example, trying to pass Apps.Editor.Stylesheets will result in

Error: I couldn't find the entry module Apps.Editor.Stylesheets.

Maybe you meant: Apps
You can pass me a different module to use with --module=<moduleName>

due to these lines:

if (!(stylesheetsModule in Elm)){
  return reject(missingEntryModuleMessage(stylesheetsModule, Elm));
}

A potential fix would have to walk the module name hierarchy both when looking up the module to create the worker and in the suggestModulesNames function for printing available modules when the module given truly isn't there

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

No branches or pull requests

1 participant