Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find type constructor WebGL.Shader #1557

Open
Zinggi opened this issue Jan 15, 2017 · 2 comments
Open

Could not find type constructor WebGL.Shader #1557

Zinggi opened this issue Jan 15, 2017 · 2 comments

Comments

@Zinggi
Copy link

Zinggi commented Jan 15, 2017

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:

SSCCE

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

Steps to reproduce

Try to compile Main.elm:
elm make Main.elm

Workarounds

Variant 1

Create a new file Test.elm.

module Test exposing (..)

import Html

main = Html.text "test"

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 of Shaders.elm

Now compiling works.

OS browser Elm version
arch linux NA elm-make 0.18 (Elm Platform 0.18.0)
@process-bot
Copy link

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.

@marrony
Copy link

marrony commented Mar 24, 2017

related #1322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants