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

Error when compiling a namespace with :require-macros and :refer #449

Closed
Akeboshiwind opened this issue Dec 20, 2023 · 3 comments
Closed

Comments

@Akeboshiwind
Copy link

version

0.4.84

problem

I'm getting Error: fileURLToPath is not ISeqable when trying to (:require [xxx :refer [xxx]]) and :require-macros in the same ns.

repro

Project setup:

$ mkdir squint-test && cd squint-test
$ npm init -y
$ npm install squint-cljs@latest
squint.edn
{:paths ["src"]}
src/macro_scratch.cljc
(ns macro-scratch)

(defmacro my-print [value]
  `(println ~value))
src/example.cljs
(ns example
  (:require-macros [macro-scratch :refer [my-print]])
  (:require ["url" :refer [fileURLToPath]]))

(println (fileURLToPath js/import.meta.url))

Repro:

$ npx squint compile
Full output
[squint] Compiling CLJS file: /Users/osm/prog/prog/clojure/squint/src/example.cljs
file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:42
$APP.x=function(a){if(null==a)return null;if(null!=a&&(a.D&8388608||$APP.Oc===a.Ee))return a.Y(null);if($APP.Xa(a)||"string"===typeof a)return 0===a.length?null:new $APP.Xc(a,0,null);if(null!=a&&null!=a[Zc])return a=$APP.xa(a,Zc).call(a),ad.h?ad.h(a):ad.call(null,a);if($APP.cb(bc,a))return $APP.cc(a);throw Error([$APP.t.h(a)," is not ISeqable"].join(""));};$APP.y=function(a){if(null==a)return null;if(null!=a&&(a.D&64||$APP.Oc===a.ad))return a.Fa(null);a=$APP.x(a);return null==a?null:rb(a)};
                                                                                                                                                                                                                                                                                                                    ^

Error: fileURLToPath is not ISeqable
    at $APP.x (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:42:309)
    at $APP.g.cd (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:658:254)
    at nc (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:30:45)
    at $APP.g.Ia (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:605:243)
    at $APP.oe.j (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:440:74)
    at $APP.Rg.g (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:582:97)
    at Function.d [as g] (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:519:159)
    at $APP.Jk.A (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:591:456)
    at $APP.Jk.A (file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:591:385)
    at file:///Users/osm/prog/prog/clojure/squint/node_modules/squint-cljs/lib/compiler.js:268:271

Node.js v21.1.0

expected behavior

To be able to import both a macro and a :referd function

@borkdude
Copy link
Member

Hmm, I do have test project for this, but I'll look into this!

@borkdude
Copy link
Member

Yep, can reproduce!

@borkdude
Copy link
Member

Fixed in 0.4.85

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