Skip to content

TypeError: GLctx is undefined #2112

@Ycblue

Description

@Ycblue

Hi, I'm fairly new at WASM and WebGL and I have been trying to run the shader tutorial from DanRuta (https://github.com/DanRuta/webassembly-webgl-shaders) and my browser always runs into this error when running the index.html file.
The details of the error look like this:
`TypeError: GLctx is undefined[Weitere Informationen] appWASM.js:1:250880

_glCreateProgram http://localhost:8080/dist/appWASM.js:1

<anonym> http://localhost:8080/dist/appWASM.wasm:251208

<anonym> http://localhost:8080/dist/appWASM.wasm:251921

_createContext http://localhost:8080/dist/appWASM.js:1

ccall http://localhost:8080/dist/appWASM.js:1

createCanvas http://localhost:8080/:25

loadImage http://localhost:8080/:45`

I gather that there is some type error going on in the generated js file, but i'm really not familiar with it. Do you have any idea what could have caused this error?

Edit:
The build command I used was:
emcc -o ./dist/appWASM.js ./dev/cpp/emscripten.cpp -O3 -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -std=c++1z -s EXTRA_EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap']" -s LINKABLE=1 -s EXPORT_ALL=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions