Comments (14)
I just released version 2.27.2
, which downgrades the Closure Compiler version back to the previous working one.
I could not figure out why this fails. Using the npm google-closure-compiler
to compile squint-cljs/core
works just fine without issue. I'll revisit this with the next closure compiler release. Hopefully it fixes itself then.
from shadow-cljs.
I just cut a new 2.28.2
release, using the recently released v20240317 closure-compiler version. It appears that the packages previously failing now compiled. Please give it a try and report back problems.
from shadow-cljs.
2.27.1 included an upgrade in the Closure Compiler, which I guess if the problem here.
I'll see if I can figure something out, or maybe downgrade the GCC version again.
from shadow-cljs.
This is also breaking our build too. Same error, but on chart.js
Node(COMPUTED_PROP): node_modules/chart_DOT_js/dist/chart.cjs:509:16
const { [iAxis]: index , [vAxis]: value } = item;
Parent(OBJECT_PATTERN): node_modules/chart_DOT_js/dist/chart.cjs:509:14
const { [iAxis]: index , [vAxis]: value } = item;```
from shadow-cljs.
One temporary fix is setting :compiler-options {:output-feature-set :es-unstable}
, which just disables the problematic RewriteClassMembers
compiler pass.
Still trying to figure out if I can maybe tweak this, so I don't have to do a rollback of the Closure Compiler version.
from shadow-cljs.
FYI: I'm also getting that "failed to convert sources" error, but on a different package:
Caused by:
NullPointerException: NAME a$jscomp$578 2:4095 [length: 1] [source_file: node_modules/react-hook-form/dist/index.cjs.js] [original_name: a]
Full trace:
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources-simple*/fn--90216 (closure.clj:2072)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1357)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1350)
shadow.build.compiler/compile-all (compiler.clj:1606)
shadow.build.compiler/compile-all (compiler.clj:1469)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:368)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:349)
shadow.cljs.devtools.server.worker.impl/eval93007/fn--93009 (impl.clj:448)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--92765/fn--92766/fn--92774 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--92765/fn--92766 (util.clj:282)
shadow.cljs.devtools.server.util/server-thread/fn--92765 (util.clj:255)
java.lang.Thread.run (Thread.java:1583)
Caused by:
NullPointerException: NAME a$jscomp$578 2:4095 [length: 1] [source_file: node_modules/react-hook-form/dist/index.cjs.js] [original_name: a]
com.google.common.base.Preconditions.checkNotNull (Preconditions.java:921)
com.google.javascript.jscomp.RemoveUnusedCode.getVarForNameNode (RemoveUnusedCode.java:858)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNameNode (RemoveUnusedCode.java:711)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:535)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseCall (RemoveUnusedCode.java:769)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:463)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:547)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseFunction (RemoveUnusedCode.java:1414)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:432)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseCall (RemoveUnusedCode.java:769)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:463)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:547)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseNode (RemoveUnusedCode.java:547)
com.google.javascript.jscomp.RemoveUnusedCode.traverseChildren (RemoveUnusedCode.java:1262)
com.google.javascript.jscomp.RemoveUnusedCode.traverseFunction (RemoveUnusedCode.java:1414)
com.google.javascript.jscomp.RemoveUnusedCode$Continuation.apply (RemoveUnusedCode.java:1774)
com.google.javascript.jscomp.RemoveUnusedCode.traverseAndRemoveUnusedReferences (RemoveUnusedCode.java:378)
com.google.javascript.jscomp.RemoveUnusedCode.process (RemoveUnusedCode.java:352)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:240)
com.google.javascript.jscomp.PhaseOptimizer$Loop.process (PhaseOptimizer.java:378)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:179)
com.google.javascript.jscomp.Compiler.performTranspilationAndOptimizations (Compiler.java:2966)
com.google.javascript.jscomp.Compiler.lambda$stage2Passes$7 (Compiler.java:1025)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:126)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:1073)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:1022)
com.google.javascript.jscomp.Compiler.compile (Compiler.java:908)
jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
java.lang.reflect.Method.invoke (Method.java:580)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:167)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:102)
shadow.build.closure/convert-sources-simple*/fn--90216/fn--90217 (closure.clj:2062)
shadow.build.closure/convert-sources-simple*/fn--90216 (closure.clj:2060)
shadow.build.closure/convert-sources-simple* (closure.clj:2059)
shadow.build.closure/convert-sources-simple* (closure.clj:1923)
shadow.build.closure/convert-sources-simple (closure.clj:2233)
shadow.build.closure/convert-sources-simple (closure.clj:2183)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1357)
shadow.build.compiler/maybe-closure-convert (compiler.clj:1350)
shadow.build.compiler/compile-all (compiler.clj:1606)
shadow.build.compiler/compile-all (compiler.clj:1469)
shadow.build.api/compile-sources (api.clj:261)
shadow.build.api/compile-sources (api.clj:253)
shadow.build/compile (build.clj:512)
shadow.build/compile (build.clj:493)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:368)
shadow.cljs.devtools.server.worker.impl/build-compile (impl.clj:349)
shadow.cljs.devtools.server.worker.impl/eval93007/fn--93009 (impl.clj:448)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--92765/fn--92766/fn--92774 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--92765/fn--92766 (util.clj:282)
shadow.cljs.devtools.server.util/server-thread/fn--92765 (util.clj:255)
java.lang.Thread.run (Thread.java:1583)
from shadow-cljs.
That :output-feature-set :es-unstable
makes it work for me as well by the way. Is that suitable for production builds would you say?
from shadow-cljs.
Hmm react-hook-form works fine for me, even without that :output-feature-set
.
Wether this is suitable for production or not I cannot say. Not sure which kind of features the code is actually using and how far back you need to go with browser support. The problematic feature on the other two is well supported in all browsers, so that should be fine. Still best to test though.
from shadow-cljs.
@thheller I just tried with the new version; it gives the same error for me I'm afraid (when using :es8
).
from shadow-cljs.
Any particular reason you are setting :es8
?
I'm really not keen on downgrading again since this version also fixes some other issues.
from shadow-cljs.
The new version seems to work perfectly for us, thanks
from shadow-cljs.
Any particular reason you are setting
:es8
?I'm really not keen on downgrading again since this version also fixes some other issues.
No not really. This is in development mode only. Not sure why it's there. What do you normally use for development?
from shadow-cljs.
I'd set the same value for development as in production, which should correspond for the Browser version you are expected to support. It makes zero sense to only set it for development, ever to any value.
If you have to support IE11, which noone should nowadays, then you need to set :es5
probably.
If you just want to support modern browsers don't set it to anything at all. The default is :es2020
which is already extemely conservative, given that browsers nowadays auto update and having 4 year old versions is uncommon and many browsers supported ES2020 features long before the ES2020 spec was finalized.
You can increase it higher if your know your audience is going to have up-to-date browsers, e.g. for internal UIs. I stick to the default, since it doesn't matter whatsoever for CLJS and is usually only used for JS deps that want to use cutting edge JS features that might be a bit too cutting edge for the average user.
ES2020 is what I would consider safe and my condolences to anyone having to support lower.
from shadow-cljs.
Thanks for your detailed answer Thomas! I just verified that the default now also works. A while back we needed to add the output features set because of some library IIRC, but apparently it's no longer needed. So all good now! :)
from shadow-cljs.
Related Issues (20)
- Warnings on using decprecated-fn in a deprecated-fn HOT 3
- CLJS build failure HOT 2
- class shadow.undertow$fn$reify__11358 cannot be cast to class clojure.lang.Var$Frame HOT 3
- Requiring a namespace with an underscore instead of dash gets par-compile stuck
- :js-provider :external should support :modules
- Mention that build report only works for :browser target HOT 9
- Issue with CORS in dev HTTP server since 2.25.10 release HOT 2
- :module-hash-names doesn't work with :web-worker true
- Build report for :node-library builds needlessly requires :output-dir
- Preloads with a top-level namespace don't load macros HOT 3
- 2.26.5 incorrectly tagging @dagrejs/dagre npm module js file as es3 HOT 2
- date-fns v3.3.1 and shadow-cljs 2.26.5 to 2.26.6 triggers ICE HOT 2
- npm-module exports vars in random order with large namespaces HOT 2
- Check namespaced keywords for build ids
- More readable error log with pre-line for browser-test HOT 3
- Srting handling different to clj HOT 1
- `Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.tools.analyzer.utils/update-vals` when trying to import a dependency via git HOT 9
- #shadow/env not working in ~/.config/shadow-cljs/config.edn? HOT 7
- How to debug the par-compiler for :cache-level :all HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shadow-cljs.