Simple program compiled without error gives a white page

给你一囗甜甜゛ 提交于 2019-12-23 10:06:12

问题


I compiled the "Hello world" program

import Html exposing (text)

main =
  text "Hello, World!"

with elm 0.17 on Windows, without compile errors:

elm make hello.elm --output index.html

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

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

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"
}

What should I do ?


回答1:


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



来源:https://stackoverflow.com/questions/37551769/simple-program-compiled-without-error-gives-a-white-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!