简单程序编译无错误,给出白页 [英] Simple program compiled without error gives a white page

查看:59
本文介绍了简单程序编译无错误,给出白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编译了 你好世界程序

import Html exposing (text)

main =
  text "Hello, World!"

在Windows上使用Elm 0.17,没有编译错误:

with elm 0.17 on Windows, without compile errors:

elm make hello.elm --output index.html

当我在index.html上打开Chrome时,出现空白页。 Chrome的控制台在index.html中显示2个错误:

When I open Chrome on index.html, I get a blank page. Chrome's console shows 2 errors in index.html :

Uncaught ReferenceError: _elm_lang$virtual_dom$VirtualDom$text is not defined
Uncaught ReferenceError: Elm is not defined

如果我对该文件运行elm-reactor,我也

If I run the elm-reactor on that file, I also get a white page, and similar errors in the console.

不知何故,路径丢失了……这是elm-package.json文件:

Somehow, a path is missing... Here is the elm-package.json file:

{
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
    "."
],
"exposed-modules": [],
"dependencies": {
    "elm-lang/core": "4.0.0 <= v < 5.0.0",
    "elm-lang/html": "1.0.0 <= v < 2.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}

我该怎么办?

推荐答案

我通过删除elm-stuff子目录对其进行了修复。在下一个版本中,它将重新安装缺少的软件包,并且一切正常。

I fixed it by deleting the elm-stuff subdirectory. At the next make, it reinstalls the missing packages, and everything works fine.

这篇关于简单程序编译无错误,给出白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆