This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-28
Channels
- # announcements (5)
- # babashka (7)
- # beginners (101)
- # biff (9)
- # calva (46)
- # cider (6)
- # clj-yaml (2)
- # cljsrn (13)
- # clojure (11)
- # clojure-europe (43)
- # clojure-nl (13)
- # clojure-norway (22)
- # clojurescript (20)
- # conjure (1)
- # cursive (7)
- # data-science (2)
- # datomic (26)
- # emacs (38)
- # graphql (27)
- # gratitude (5)
- # hoplon (8)
- # hugsql (22)
- # humbleui (2)
- # hyperfiddle (6)
- # introduce-yourself (8)
- # joyride (3)
- # lsp (79)
- # malli (6)
- # nbb (67)
- # portal (16)
- # rdf (27)
- # reagent (42)
- # releases (2)
- # remote-jobs (1)
- # shadow-cljs (36)
- # test-check (17)
- # tools-deps (1)
- # xtdb (15)
I got this today when running Krell on ios emulator. Anyone else see this? App was working and reloading worked. So not sure if it is something to be ignored or not.
ERROR Could not evaluate [SyntaxError: 14:1:invalid statement encountered.]
ERROR Could not evaluate [SyntaxError: 17:32:Invalid expression encountered]
ERROR Could not evaluate [SyntaxError: 16:21:Invalid expression encountered]
ERROR Could not evaluate [SyntaxError: 15:1:invalid statement encountered.]
ERROR Could not evaluate [SyntaxError: 16:1:invalid statement encountered.]
ERROR Could not evaluate [SyntaxError: 9:20:Invalid expression encountered]
ERROR Could not evaluate [SyntaxError: 27:1:invalid statement encountered.]
ERROR Could not evaluate [SyntaxError: 9:1:invalid statement encountered.]
ERROR Could not evaluate [SyntaxError: 11:1:invalid statement encountered.]
I have the same issue after upgrading from React Native 0.69.3 to 0.70.6 and Krell to 0.5.4 .
The reported invalid statements happen in the`class` keyword. Ex. here are the first lines of safescript.js until the line with the class
keyword where the error happens ...
/*TRANSPILED*/goog.loadModule(function(exports) {'use strict';/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
'use strict';
goog.module("goog.html.SafeScript");
goog.module.declareLegacyNamespace();
const Const = goog.require("goog.string.Const");
const TypedString = goog.require("goog.string.TypedString");
const trustedtypes = goog.require("goog.html.trustedtypes");
const {fail} = goog.require("goog.asserts");
const CONSTRUCTOR_TOKEN_PRIVATE = {};
class SafeScript {
constructor(value, token) {
...
Any idea about why this happens and/or how to get rid of it?I suspect it's because of Hermes, the new default JS engine since RN 0.70 https://reactnative.dev/blog/2022/09/05/version-070#hermes-as-default-engine
Although it's not exactly the same issue that we find with ClojureScript, this is what led me to that https://github.com/facebook/hermes/issues/474
I've just tried disabling Hermes in iOS ( https://reactnative.dev/docs/hermes#switching-back-to-javascriptcore ) . The errors disappear once Hermes is disabled.
This is correct, Hermes does not support ES6 classes: https://github.com/facebook/hermes/issues/685
Theoretically, I think you should be able to set the Closure compiler to output ES5 code and for it to work in Hermes, but it didn’t work immediately for me when I tried it and I didn’t have time to follow up.
Does anyone know whether shadow-cljs works with Hermes? I don’t have any projects that use it.
Thanks! I understand the main benefit of Hermes is that the app starts faster. It would be great to be able to take advantage of that with ClojureScript apps... but for me it would be even greater to finish my app 🙂 so I 'm not going to spend time now trying to make the Closure compiler to output ES5 code.
@U08QBRKUL Same. As it is now, startup is imperceptible for my app, so it would be a while until I actually needed some kind of boost from Hermes.
https://clojurians.slack.com/archives/C0E1SN0NM/p1669091301732769?thread_ts=1666918814.500569&cid=C0E1SN0NM
yes, it works when compiled with :output-feature-set :es5
option
I have the same issue after upgrading from React Native 0.69.3 to 0.70.6 and Krell to 0.5.4 .
The reported invalid statements happen in the`class` keyword. Ex. here are the first lines of safescript.js until the line with the class
keyword where the error happens ...
/*TRANSPILED*/goog.loadModule(function(exports) {'use strict';/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
'use strict';
goog.module("goog.html.SafeScript");
goog.module.declareLegacyNamespace();
const Const = goog.require("goog.string.Const");
const TypedString = goog.require("goog.string.TypedString");
const trustedtypes = goog.require("goog.html.trustedtypes");
const {fail} = goog.require("goog.asserts");
const CONSTRUCTOR_TOKEN_PRIVATE = {};
class SafeScript {
constructor(value, token) {
...
Any idea about why this happens and/or how to get rid of it?Does anyone know whether shadow-cljs works with Hermes? I don’t have any projects that use it.