我阅读了elm-live的文档,发现必须使用-- --debug
才能正常工作。我尝试过elm-live src/Main.elm -- --debug
,但即使这样也无法正常工作。我没有收到任何错误消息或任何消息,服务器只是正常启动,但没有打开时间旅行调试器。但是,它与elm make一起使用。
我尝试了elm-live的稳定版本和最新版本,并已将节点更新为最新版本,但是它不起作用。
如果有帮助的话,我正在使用最新版本的榆木(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