Compiler: Incoming ports that take unit as an argument causes a crash at runtime

Created on 10 May 2016  Â·  3Comments  Â·  Source: elm/compiler

If you have an incoming port with the unit type:

port myIncomingPort : (() -> msg) -> Sub msg

this causes a crash when trying to embed the Elm application in Javascript:

Main.js:9940 Uncaught ReferenceError: _Tuple0 is not defined(anonymous function) @ Main.js:9940(anonymous function) @ Main.js:11929
app.ts:33 ReferenceError: Elm is not defined(…)
bug ports

Most helpful comment

Until then, if anyone is experiencing this bug you can work around it by sending an empty record {} over the port instead

All 3 comments

I haven't reopened that PR because I haven't had time to get an elm dev env set up to test the fix. If someone wants to take that code and test it and submit a new pr that would be excellent

Until then, if anyone is experiencing this bug you can work around it by sending an empty record {} over the port instead

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jvoigtlaender picture jvoigtlaender  Â·  4Comments

maxsnew picture maxsnew  Â·  3Comments

willnwhite picture willnwhite  Â·  4Comments

Carlsson87 picture Carlsson87  Â·  3Comments

ShalokShalom picture ShalokShalom  Â·  3Comments