Node.js target fails with optimizations set to :none or :whitespace

Description

Compiling a hello world program for Node.js works fine if using optimizations of :advanced or :simple, but if using :none or :whitespace then an error will be reported for either "goog undefined" or "goog.string" undefined respectively.

The program is shown here:

This program is in src/cljs/pr/core.cljs. The repl line used to compile is:

When compiled with optimizations of :none, the output is:

When running with optimizations of :whitespace the output is:

When running with optimizations of either :simple or :advanced, the output is:

I have included the two javascript output files that match the above errors.

Environment

Clojure 1.5.0-RC16
Clojurescript 0.0-1586
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
OSX Mountain Lion 10.8.2

Activity

Show:
Paula Gearon
February 21, 2013, 10:40 PM

Remaining generated files

David Nolen
February 25, 2013, 9:46 PM

This is a known bug. We need goog.require/provide to actually mean something to Node.js. I'm not sure how this can be made to work. I've been hoping for a patch for this since ClojureScript was first announced, but I haven't seen anything yet.

David Nolen
December 2, 2014, 12:20 PM

long ago fixed in master.

Assignee

Unassigned

Reporter

Paula Gearon

Labels

Approval

None

Patch

None

Priority

Minor
Configure