-
Notifications
You must be signed in to change notification settings - Fork 753
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
TypeError: GLctx is undefined #2112
Comments
Try building without optimizations, or with adding Otherwise, I'd build with |
Hi, thanks for the fast reply! Meanwhile, another different thing happened earlier with the same code. After the WASM and JS files were built, I had to manually correct an IF-clause in the JS file. Since it is generated automatically with glue code, I assume it has to be a bug of some kind? |
Sounds like that could be a bug, yes. If you can't figure it out, if you can provide a testcase showing the problems that should be enough for us to debug them. |
I encountered the same error and needed to make a minor change to the tutorial code. emscripten_webgl_create_context() (in the tutorial's Context.cpp) failed to find the Canvas by id. I fixed the code in Context::Context() to append a '#' in front of the id before calling emscripten_webgl_create_context(). You could also compile with DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 which uses the old getElementById() method instead of querySelector(). Though this is not recommended and will generate a console warning. |
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
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
The text was updated successfully, but these errors were encountered: