dillonkearns / elm-pages

Hybrid Elm framework with full-stack and static routes.
https://elm-pages.com
BSD 3-Clause "New" or "Revised" License
658 stars 97 forks source link

elm-pages run script/src/AddRoute.elm fails when run before first build #430

Open adamdicarlo opened 1 year ago

adamdicarlo commented 1 year ago

I'm using Elm Pages v3.0.9.

This is easy to reproduce with this command:

$ npx elm-pages init my-site && cd my-site && npx elm-pages run script/src/AddRoute.elm AboutThisSite

The output I get is:

Creating my-site project...
Project is successfully created in `/home/adam/src/my-site`.
Trace
    at Command.<anonymous> (file:///home/adam/.npm/_npx/f522c3e74dfcf71b/node_modules/elm-pages/generator/src/cli.js:168:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

If I run npx elm-pages build, I can then run the elm-pages run ... command successfully.

dillonkearns commented 1 year ago

I'm not able to reproduce that one:

---mbp:~srctmpmy-site 2023-11-03 at 11 45 52 AM

adamdicarlo0 commented 12 months ago

Thanks for taking a look. I think this might be due to missing tools, because I'm running without almost anything globally installed. If that's the case, the bug is that there's no error message (it's an empty string). I'm digging in a bit to see what's happening.

Do you have lamdera, elm-review, and other tools that an elm-pages build uses installed globally?

dillonkearns commented 12 months ago

Gotcha, that would probably explain it! I might not have those checks for running scripts, I do have them for the build and dev server I think. Thanks for the context!

dillonkearns commented 12 months ago

And yes, I do have those tools installed globally on my PATH.