Comments (3)
I did a quick debug and found the cause in CLJS directly, at least I think so.
Basically the fix is to (require 'bug-shadow-macro-repl)
first, since that creates the necessary analyzer info CLJS seems to base this off.
The CLJS code has a path that checks (.contains nstr ".")
and only then tries to look at namespaces directly then. Without a dot it only checks namespaces the current namespace has required, not the global ones. Since with preloads that require is missing, it ends up as unresolved.
(defn get-expander-ns [env ^String nstr]
;; first check for clojure.* -> cljs.* cases
(let [res (or (resolve-macro-ns-alias env nstr nil)
(resolve-ns-alias env nstr nil))
nstr (if (some? res) (str res) nstr)]
(cond
#?@(:clj [(= "clojure.core" nstr) (find-ns 'cljs.core)]
:cljs [(identical? "clojure.core" nstr) (find-macros-ns impl/CLJS_CORE_MACROS_SYM)])
#?@(:clj [(= "clojure.repl" nstr) (find-ns 'cljs.repl)]
:cljs [(identical? "clojure.repl" nstr) (find-macros-ns 'cljs.repl)])
#?@(:clj [(.contains nstr ".") (find-ns (symbol nstr))]
:cljs [(goog.string/contains nstr ".") (find-macros-ns (symbol nstr))])
:else (some-> env :ns :require-macros (get (symbol nstr)) #?(:clj find-ns
:cljs find-macros-ns)))))
- https://github.com/clojure/clojurescript/blob/22e3dc42d60747c3187bedb82079101caf049549/src/main/clojure/cljs/analyzer.cljc#L3947
- https://github.com/clojure/clojurescript/blob/22e3dc42d60747c3187bedb82079101caf049549/src/main/clojure/cljs/analyzer.cljc#L931
Do you want to try to recreate this issue CLJS only? I can see if I can work around this, but it seems to be entirely in code shadow-cljs doesn't control.
from shadow-cljs.
I'll open a bug with CLJS. Thanks for investigating!
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
- 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
- Compiling squint-cljs (via @nextjournal/clojure-mode) on 2.27.1 throws ICE HOT 14
- 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.