eeue56 / elm-blogger

A blogging platform written in Elm + Elixir
BSD 3-Clause "New" or "Revised" License
102 stars 12 forks source link

Problem on first server start #11

Open fredcy opened 8 years ago

fredcy commented 8 years ago

When I install and run this application from scratch on OS X I always get an error when I first run mix phoenix.server and browse the page:

[info] Running ElmBlogger.Endpoint with Cowboy using http on port 4000
Elm compile: Main.elm, in web/static/elm, to ../../../priv/static/js/elm/main.js
20 Apr 10:24:47 - info: /Users/fcy/Documents/elm/elm-blogger/node_modules/brunch/lib/fs_utils/file_list.js:194
        if (error) throw new Error(formatError('Reading', error));
                   ^

Error: undefined of Error: ENOENT: no such file or directory, open 'web/static/elm/elm-stuff/packages/elm-lang/core/elm-lang-core-243a31b/CONTRIBUTING.md' failed.
  at /Users/fcy/Documents/elm/elm-blogger/node_modules/brunch/lib/fs_utils/file_list.js:194:26
  at ReadFileContext.callback (/Users/fcy/Documents/elm/elm-blogger/node_modules/fcache/index.js:19:23)
  at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:324:13)

When I then interrupt (abort) the phoenix server and start again, no errors appear and the page works as expected.

So something goes wrong the first time through. I think I've seen the same thing recur if I delete elm-stuff completely.

eeue56 commented 8 years ago

I defer to @knewter

fredcy commented 8 years ago

I think this relates to everything within web/static being watched, including web/static/elm/elm-stuff.

Adding "elm-stuff" as an exclusion in conventions.ignored does not suffice.

cpursley commented 8 years ago

I can confirm this issue. Works fine after Phoenix server restart.

optikfluffel commented 8 years ago

I have something similar, but here LICENSE couldn't be found.

[info] Running ElmBlogger.Endpoint with Cowboy using http on port 4000
Elm compile: Creator/Main.elm, in web/static/elm, to ../../../priv/static/js/elm/main.js
24 May 18:02:15 - info: /Users/username/Desktop/elm-blogger/node_modules/brunch/lib/fs_utils/file_list.js:194
        if (error) throw new Error(formatError('Reading', error));
                   ^

Error: undefined of Error: ENOENT: no such file or directory, open 'web/static/elm/elm-stuff/packages/NoRedInk/elm-decode-pipeline/NoRedInk-elm-decode-pipeline-991413f/LICENSE' failed. 
  at fcache.updateCache.error (/Users/username/Desktop/elm-blogger/node_modules/brunch/lib/fs_utils/file_list.js:194:26)
  at ReadFileContext.callback (/Users/username/Desktop/elm-blogger/node_modules/fcache/index.js:19:23)
  at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13)

And also simply restarting the server seems to work.