Comments (5)
Great point! That should definitely give a non-zero exit status and print the error message.
from elm-pages.
I'm not able to reproduce it on master:
module Todo exposing (run)
import BackendTask
import Pages.Script as Script exposing (Script)
run : Script
run =
Script.withoutCliOptions
(BackendTask.succeed ()
|> BackendTask.andThen
(\_ ->
Debug.todo "!!!TODO!!!!"
)
)
from elm-pages.
npx elm-pages run script/src/Todo.elm
Trace: Error: TODO in module `Todo` on line 13
!!!TODO!!!!
at _Debug_crash (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:498:10)
at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:254:3
at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9176:7
at Function.f (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9085:13)
at A2 (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:56:28)
at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9168:2
at Object.<anonymous> (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9306:5)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Command.<anonymous> (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/cli.js:168:17)
Trace: Unexpected error format Unexpected error {}
at restoreColor (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/error-formatter.js:104:13)
at restoreColorSafe (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/error-formatter.js:121:14)
at Command.<anonymous> (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/cli.js:169:21)
Error: TODO in module `Todo` on line 13
!!!TODO!!!!
from elm-pages.
Exits with code 1.
from elm-pages.
Got it!
module Repro exposing (run)
import BackendTask
import Pages.Script as Script exposing (Script)
run : Script
run =
Script.log "Just"
|> BackendTask.andThen (\_ -> Debug.todo "break")
|> Script.withoutCliOptions
It's very subtle! succeed ()
instead of Script.log
will give the correct error
from elm-pages.
Related Issues (20)
- elm-pages run script/src/AddRoute.elm fails when run before first build HOT 4
- [SSCCE] ANSI escape codes in `onError` and `ErrorPage` error messages
- Provide a way to render static 404 pages using elm-pages HOT 2
- Replace StaticHttp examples in BackendTask HOT 1
- Cannot watch for fragment changes in URL
- Scroll is reset on back navigation HOT 1
- DeadCodeEliminateData errors cached in elm-stuff
- Feature request: `Pages.Script.writeFileBinary`/`BackendTask.File.rawBinary` HOT 2
- `elm-pages build` inserts `import FatalError` into unit test modules HOT 2
- Update .gitignore generator template for elm-pages-cli-mjs HOT 1
- Compilation error when using `elm-pages docs` HOT 9
- npx elm-pages run <script name> does not work on Windows HOT 1
- Vite Pre-transform error after upgrade HOT 9
- Initialization failed while loading node modules HOT 4
- Compatibility Keys match, but elm-pages says they don't when running script HOT 7
- Feature request: `BackendTask.race` HOT 1
- Feature request: `Script.stateful` HOT 1
- INTERNAL ERROR when calling custom task. HOT 1
- BadBody: INTERNAL ERROR when input to Backend.Custom.run is mutated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-pages.