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

Runtime error with 8.10: h$ghcjszmprimZCGHCJSziPrimziJSVal_con_e is not defined #809

Open
dfordivam opened this issue Aug 4, 2021 · 2 comments

Comments

@dfordivam
Copy link
Contributor

Hi

I am using the ghcjs 8.10 via Haskell.nix, and hit this issue when using reflex-dom package.

lib.js:1868 Uncaught ReferenceError: h$ghcjszmprimZCGHCJSziPrimziJSVal_con_e is not defined
    at lib.js:1868
rts.js:7280 uncaught exception in Haskell main thread: TypeError: Cannot read property '1' of undefined
rts.js:7280 TypeError: Cannot read property '1' of undefined
    at h$base_isatty (lib.js:3861)
    at h$$jQ (out.js:13998)
    at h$runThreadSlice (rts.js:8456)
    at h$runThreadSliceCatch (rts.js:8421)
    at h$mainLoop (rts.js:8414)
    at rts.js:2518
    at runIfPresent (rts.js:2537)
    at onGlobalMessage (rts.js:2585)

This seems to be caused by the following commit

commit e4cd4232a31f6371c761acd93853702f4c7ca74c (HEAD -> ghc-8.10, moto/hkm/nix-ghc-8.10, moto/ghc-8.10)
Author: Luite Stegeman <stegeman@gmail.com>
Date:   Tue Jun 29 14:54:58 2021 +0200

    Remove additional JSVal constructor initializer. apparently this was
    used for debugging only, but it causes tools to complain about
    duplicate declarations.

    Multi-file index.html (rts.js, out.js, lib.js, runmain.js) appears
    to run fine with this removed.

Source: dfordivam/try-haskell-nix@0271303

ghcjs "rev": "e4cd4232a31f6371c761acd93853702f4c7ca74c",

haskell.nix rev: 9d940715665e28af6a60c760946330c6c63f2e29

@dfordivam
Copy link
Contributor Author

I confirmed at my end that the e4cd423 indeed is the cause behind the error.

@cdfa
Copy link

cdfa commented Sep 17, 2021

Ran into the same issue today, but was able to fix it (for my project at least) by using an single-file index.html, e.g.

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>JSaddle</title>
  <script src="all.js"></script>
</head>

<body>
</body>

</html>

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

No branches or pull requests

2 participants