-
Notifications
You must be signed in to change notification settings - Fork 40
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
castTo HTMLInputElement/HTMLTextAreaElement failing #108
Comments
Ok
specifically this line:
I initially manually fixed this and wasn't 100% sure of the underlying cause, but after replacing |
Foreign imports in ghcjs-dom-javascript haven't been all ported to the new syntax. Especially this one in your case: https://github.com/ghcjs/ghcjs-dom/blob/d01210f68c46fe336f0fe74ad8b6dd9b5387e155/ghcjs-dom-javascript/src/GHCJS/DOM/Types.hs#L1058 |
Oof that's what I get for trusting github search, yes that is definitely the problematic line. |
I think this is fixed now. |
@hamishmack I'm having the same problem trying to use
But with Edit: Tested it on 9.8.2 and 9.10.1 |
@ymeister You must have a foreign import somewhere that looks like: foreign import javascript "window[\"HTMLInputElement\"]" whatever :: ... It must be changed into a function: foreign import javascript "(() => window[\"HTMLInputElement\"])" whatever :: ... The JS backend only supports functions in foreign imports. |
Actually if you grep for |
@hsyl20 that makes sense! Thanks a lot! |
When building with new js backend, the following code breaks:
as does the equivalent code with
HTMLTextAreaElement
. The error message is:and the underlying generated code that breaks is:
Following the suggested fix with
new
just gives a different error:This is using commit
9b4b41a
of this repo, onhaskell.nix
commit660bbe7
, withghc-9.8.2
.The text was updated successfully, but these errors were encountered: