gdotdesign / elm-ui

UI library for making web applications with Elm
https://elm-ui.netlify.com
BSD 2-Clause "Simplified" License
920 stars 39 forks source link

importing modules fails #43

Closed mbadziong closed 7 years ago

mbadziong commented 7 years ago

I have simple project generated by elm-ui init command. Now I'im trying to add simply module, for example exposing only one string. After importing it in Main module, elm-ui build fails with error:

Copying public folder contents...
Building HTML...
Building JavaScript: Main...
  > I cannot find module 'TestModule'.
  >
  > Module 'Main' is trying to import it.
  >
  > Potential problems could be:
  >   * Misspelled the module name
  >   * Need to add a source directory or new dependency to elm-package.json
  >

Build failed!

I'm not doing some magic here. It's simpliest as possible module, placed directly next to Main.elm. Windows 10, 64x

gdotdesign commented 7 years ago

Sorry about that, it seems that the generated elm-package.json have incorrect source-directories field:

"source-directories": [
   "."
],

It should be like this:

"source-directories": [
  "source"
],

I'll fix it in the next release, thanks for reporting :+1: