[ClojureScript] Figwheel build failure for CLJS 1.10.516: Error: Cannot find module '@cljs-oss/module-deps'

2019-02-12 Thread Alan Thompson
Hi - I have a re-frame app that works fine for CLJS 1.10.439, but fails in
compile for CLJS 1.10.516.  Any suggestions?

Here is the working and failing build output for `lein figwheel`:

1.10.439 - works
-
Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid ;)
Figwheel: Starting server at http://0.0.0.0:3449
Figwheel: Watching build - dev
Figwheel: Cleaning build - dev
Compiling build :dev to "resources/public/js/compiled/flintstones.js" from
["src/cljc" "src/cljs"]...
WARNING: schema.core/either is deprecated at line 13
resources/public/js/compiled/flintstones-dev/tupelo/schema.cljc
WARNING: schema.core/either is deprecated at line 1676
resources/public/js/compiled/flintstones-dev/tupelo/core.cljc
WARNING: schema.core/either is deprecated at line 1703
resources/public/js/compiled/flintstones-dev/tupelo/core.cljc
WARNING: schema.core/either is deprecated at line 1862
resources/public/js/compiled/flintstones-dev/tupelo/core.cljc
WARNING: Namespace tupelo.char contains a reserved JavaScript keyword, the
corresponding Google Closure namespace will be munged to tupelo.char$ at
line 7 resources/public/js/compiled/flintstones-dev/tupelo/char.cljc
Successfully compiled build :dev to
"resources/public/js/compiled/flintstones.js" in 15.379 seconds.
Launching ClojureScript REPL for build: dev
--

1.10.516 - fails

Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid ;)
Figwheel: Starting server at http://0.0.0.0:3449
Figwheel: Watching build - dev
Figwheel: Cleaning build - dev
Compiling build :dev to "resources/public/js/compiled/flintstones.js" from
["src/cljc" "src/cljs"]...
module.js:550
throw err;
^

Error: Cannot find module '@cljs-oss/module-deps'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at [eval]:8:13
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at Object.runInThisContext (vm.js:139:38)
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:653:30)
at evalScript (bootstrap_node.js:479:27)

WARNING: schema.core/either is deprecated at line 13
resources/public/js/compiled/flintstones-dev/tupelo/schema.cljc
^C%



Alan Thompson

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: How to require a library only if it is on the classpath?

2019-02-12 Thread Yuri Govorushchenko
> That still does not allow you to do anything you couldn't do via the ns 
form directly. require outside ns is a misleading topic and is still 
completely static.

I guess it's not a blocker for OP because the intention was to do a 
conditional require during compilation (and not during execution in 
browser)? 

Of course, I'm not sure what real root problem it solves, maybe there is a 
more idiomatic solution possible.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.


[ClojureScript] Re: How to require a library only if it is on the classpath?

2019-02-12 Thread Thomas Heller
That still does not allow you to do anything you couldn't do via the ns 
form directly. require outside ns is a misleading topic and is still 
completely static. It was just added to allow compiling scripts that don't 
have a ns form. You still can't do conditionals or run any other code 
inbetween them.

The reason that dynamic require is not possible in CLJS is that there is no 
sync/blocking IO in Browser JS. In Clojure you can simply do the work and 
return once everything is loaded properly. In JS you can't do that because 
you have to go async/non-blocking for the IO to load the files. So all of 
the remainder of the program would continue running and loading only start 
once the program yielded control back to the runtime. In addition to that 
the Closure Compiler doesn't really support dynamic requires in :advanced 
optimizations.


On Monday, February 11, 2019 at 11:40:35 PM UTC+1, Yuri Govorushchenko 
wrote:
>
> > Now I understand that 'require' in cljs is intended as a repl-only 
> thing  which expands to an ns form: 
> https://clojurescript.org/guides/ns-forms#_the_require_and_require_macros_macros
>
> It should be OK to have several requires at the top of the file. Source: 
> https://anmonteiro.com/2016/10/clojurescript-require-outside-ns/.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.