Open Zinggi opened 7 years ago
When trying to compile examples for my .obj file loader I ran into a strange issue:
elm-make: Could not find type constructor `WebGL.Shader` while checking types. elm-make: thread blocked indefinitely in an MVar operation
After some investigations, I managed to reduce it into the following two files:
Needs two files (Main.elm and Shaders.elm)
Main.elm
module Main exposing (..) import Html exposing (Html) import Shaders main = Html.text ""
Shaders.elm
module Shaders exposing (..) frag = [glsl| void main() { gl_FragColor = vec4(1.0); } |]
elm-package.json
{ "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-community/linear-algebra": "1.0.0 <= v < 2.0.0", "elm-community/webgl": "2.0.0 <= v <= 3.0.0", "elm-lang/core": "5.0.0 <= v < 6.0.0", "elm-lang/html": "2.0.0 <= v < 3.0.0" }, "elm-version": "0.18.0 <= v < 0.19.0" }
Try to compile Main.elm: elm make Main.elm
elm make Main.elm
Create a new file Test.elm.
Test.elm
module Test exposing (..) import Html main = Html.text "test"
compile it: elm make Test.elm
elm make Test.elm
The previous error vanished, elm make Main.elm now succeeds.
This is more obvious:
Add import WebGL at the top of Shaders.elm
import WebGL
Now compiling works.
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
related https://github.com/elm-lang/elm-compiler/issues/1322
When trying to compile examples for my .obj file loader I ran into a strange issue:
After some investigations, I managed to reduce it into the following two files:
SSCCE
Needs two files (Main.elm and Shaders.elm)
Main.elm
Shaders.elm
elm-package.json
Steps to reproduce
Try to compile Main.elm:
elm make Main.elm
Workarounds
Variant 1
Create a new file
Test.elm
.compile it:
elm make Test.elm
The previous error vanished,
elm make Main.elm
now succeeds.Variant 2
This is more obvious:
Add
import WebGL
at the top ofShaders.elm
Now compiling works.