2013-06-17 2 views
2

Elm 입력 예제를 this page에서 실행하려고합니다. 특히 Text Field 예를 보면 Graphics.Input 모듈이 누락되었다는 오류가 표시됩니다.Elm Graphics.Input

내가 Main.elm라는 파일이있어 : 나는 elm-server을 실행하고 localhost:8000로 이동하는 경우

import Graphics.Input as Input 

main = let (field, state) = Input.field "Type here!" 
     in lift2 display field state 

display field state = 
    field `above` asText state 

, 나는 elm --make Main.elm와 함께 프로젝트를 컴파일 에러

Your browser may not be supported. Are you using a modern browser? 

Runtime Error in Main module: 
Error: Module 'Graphics.Input' is missing. Compile with --make flag or load missing module in a separate JavaScript file. 

The problem may stem from an improper usage of: 
Input.field, above 

에게 저에게

을 제공합니다
elm: Graphics/Input.elm: openFile: does not exist (No such file or directory) 

다시 설치하려면 Graphic.Input을 설치해야합니까?

추가 참고 :

  • 나는 데비안 시스템에서이 작업을 실행하고 (2013 6월 15일) 비교적 최근에 cabal install elm를 사용하여 설치하고있다. 현재 버전은 Elm-0.7.1.1으로 표시됩니다.
  • 내가 chromium JS 프롬프트로 넘어 가서 찌르면 Elm.Graphics.Input 모듈이 없지만 이고 Elm.Input입니다. field이라는 기능이 없으며 비슷한 모양의 textField이라는 문자가 있지만 쉽게 바꿔 쓸 수있는 것은 아닙니다.

이 실행 :

import Input 

main = let (field, state) = textField "Type here!" 
     in lift2 display field state 

display field state = 
    field `above` asText state 

나에게

Your browser may not be supported. Are you using a modern browser? 

Runtime Error in Main module: 
TypeError: a is undefined 

The problem may stem from an improper usage of: 
above 
+0

언제 elm을 설치 했습니까? 지금 당장인가요, 아니면 얼마 전 이었습니까? 어떤 버전을 설치 했습니까? – sepp2k

+0

며칠 전. '.cabal/share'에있는 폴더는'Elm-0.7.1.1'이라고 불립니다. 그래서 나는 그것이 내가 가지고있는 버전이라고 가정합니다. 추가 메모로 질문을 업데이트했습니다. – Inaimathi

답변

7

Graphics.Input 패키지는 version 0.8의 새로운 오류를 제공합니다. 0.7 버전을 실행 중이므로 문제가 설명됩니다.

0.8은 다소 최근에 출시되었지만 확실히 6 월 15 일보다 오래되었습니다. 따라서 설치하기 전에 cabal update을 잊어 버린 것 같습니다. cabal update을 실행하고 elm을 0.8로 업데이트하면 문제가 해결됩니다.

관련 문제