我阅读了elm-live的文档,发现必须使用-- --debug
才能使其工作。我试过elm-live src/Main.elm -- --debug
,但它甚至不起作用。我没有收到任何错误消息,服务器只是正常启动,但没有打开时间旅行调试器。然而,它可以与elm-make一起工作。
我尝试了elm的稳定版本和最新版本,并将node更新到了最新版本中,但不起作用。
如果它有什么帮助的话,我正在使用最新版本的elm(0.19.1(
这似乎是Elm的限制,而不是Elm-live:如果您执行
elm make src/Main.elm --debug
而且你也没有得到调试器。
我认为要获得调试器,您需要使用编译器只创建JS文件,使用输出参数:
--output=<output-file>
Specify the name of the resulting JS file. For example
--output=assets/elm.js to generate the JS at assets/elm.js or
--output=/dev/null to generate no output at all!
作为参考,这是适用于我的行:
elm-live src/Main.elm --start-page="index.html" --hot --dir=docs --port=8001 --path-to-elm=node_modules/.bin/elm -- --output="docs/js-compiled/elm.js" --debug