ClojureScript

No such namespace: pg

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

I have a problem with a simple require

(ns repro.pg-ns
  (:require pg))

Repro is here: https://github.com/arichiardi/cljs-pg-error

The error is the classic Caused by: clojure.lang.ExceptionInfo: No such namespace: pg, could not locate pg.cljs, pg.cljc, or JavaScript source providing "pg" in file src/repro/pg_ns.cljs

and my compiler options look like:

{:main 'repro.pg-ns
 :output-to "out/pg-ns.js"
 :output-dir "out"
 :optimizations :none
 :source-map true
 :source-map-timestamp false
 :target :nodejs
 :install-deps true
 :npm-deps {:pg "7.4.1"}}

Activity

Hide
Corin Lawson added a comment -

I note that pg's entrypoint is ./lib (see its package.json, line 20). Setting that to be ./lib/index.js is a workaround to the problem.

Show
Corin Lawson added a comment - I note that pg's entrypoint is ./lib (see its package.json, line 20). Setting that to be ./lib/index.js is a workaround to the problem.
Hide
Andrea Richiardi added a comment - - edited

That was the problem!

Thanks a lot and sorry for the noise. I also PR-ed the repo. It seems like lumo uses more forgiving facilities compared to what CLJS is using now. I saw that the Google Closure Compiler has a couple of modes about dependency management...anyways. Again a big thank you!

Show
Andrea Richiardi added a comment - - edited That was the problem! Thanks a lot and sorry for the noise. I also PR-ed the repo. It seems like lumo uses more forgiving facilities compared to what CLJS is using now. I saw that the Google Closure Compiler has a couple of modes about dependency management...anyways. Again a big thank you!
Hide
Andrea Richiardi added a comment -

Nah, so the maintainer did not like the patch and replied:

./lib is a module by virtue of containing an index.js; you should report a bug with the failing tools.

Meaning more digging is needed.

Show
Andrea Richiardi added a comment - Nah, so the maintainer did not like the patch and replied:
./lib is a module by virtue of containing an index.js; you should report a bug with the failing tools.
Meaning more digging is needed.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: