Welcome! Please see the About page for a little more info on how this works.

+1 vote
in ClojureScript by
edited by

First, thanks for cljs, it's the best way to do frontends and it's one of the lifebloods of our business. We are super-grateful.


I am running some older code in a new project that has an updated cljs dependency and I am now getting an interesting compile warning:

WARNING: JavaScript file found on classpath for library `goog.net.cookies`, but does not contain a corresponding `goog.provide` declaration: jar:file:/home/harold/.m2/repository/org/clojure/google-closure-library/0.0-20211011-0726fdeb/google-closure-library-0.0-20211011-0726fdeb.jar!/goog/net/cookies.js

Everything seems to be working fine, but I am still interested in cleaning up this output.

I built a simple (two tiny file) project that reproduces the problem:
- https://github.com/harold/cookie-repro
- You can clone that and then do:

lein cljsprod

I did a 'bisect'-ish operation on the cljs deps in maven and found that the warning started to appear with version 1.10.891:
- https://github.com/clojure/clojurescript/blob/master/changes.md#110891
- Before that version, the warning is not seen


Wondering if others have seen this warning, or similar, and what, if any, steps would be good to take.

Thanks again for your time and consideration!

2 Answers

+1 vote
by
 
Best answer

This was not an issue with cljs at all - sorry for the noise.

For future generations of searchers, the change was in the google-closure-library, "goog.net.cookies" was deprecated and removed in favor of "goog.net.Cookies" and a more enterprise-y factory singleton getter initialization.

Link: https://github.com/google/closure-library/releases/tag/v20220301

When cljs does upgrade to newer closure library versions uses of this will break.

Thanks to everyone for your help tracking this down.

0 votes
by

Do you have an explicit dependency on google-closure-library anywhere? The version in the warning is ancient. Figure out where it comes from and remove the explicit dependency - the CLJS jar specifies it itself.

by
Thanks! I do not (at least as far as I know), here is the project file (from the repo linked in the question): https://github.com/harold/cookie-repro/blob/main/project.clj ... the only deps are the latest versions of clj and cljs (the version number seen in the warning `20211011` is an explicit dep of cljs 1.11.60).
by
Ah, huh, alright. Didn't expect for CLJS to be on such an old version, but it's probably not for a bad reason. I myself use shadow-cljs and it uses one of the most recent versions, and I've never seen that warning there.
by
Ah! I didn't notice that, but you're correct that shadow-cljs excludes the cljs closure dep and brings in a different one. And I concur, I'm quite sure there are good reasons for all of this. (: Thanks for your thoughts/help.
...