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

Fails on node.js "navigator is not defined" #6

Closed
hipitihop opened this issue May 19, 2017 · 1 comment
Closed

Fails on node.js "navigator is not defined" #6

hipitihop opened this issue May 19, 2017 · 1 comment

Comments

@hipitihop
Copy link

Although this compiles with :target :nodejs as project.clj :compiler option, it then fails with

ReferenceError: navigator is not defined
    at /home/clojure/test-node/run/resources/public/compiled_dev/parts/cuid/core.cljc:23:24
    at Object.exports.runInThisContext (vm.js:54:17)
    at nodeGlobalRequire (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/bootstrap/nodejs.js:87:6)
    at global.CLOSURE_IMPORT_SCRIPT (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/bootstrap/nodejs.js:75:3)
    at Object.goog.importScript_ (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/base.js:907:9)
    at Object.goog.writeScripts_ (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/base.js:1420:16)
    at Object.goog.require (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/base.js:673:14)
    at /home/clojure/test-node/run/resources/public/compiled_dev/parts/hat_node/calendar.js:8:6
    at Object.exports.runInThisContext (vm.js:54:17)
    at nodeGlobalRequire (/home/clojure/test-node/run/resources/public/compiled_dev/parts/goog/bootstrap/nodejs.js:87:6)

https://github.com/hden/cuid/blob/master/src/cuid/core.cljc#L23-L25

navigator & js/window likely to be an issue. Any suggestions ?

@hden hden mentioned this issue Jun 7, 2017
Closed
@hden
Copy link
Owner

hden commented Jun 7, 2017

@hipitihop I've designed a minimal API in a different namespace #8, it should be platform independent.

However the user will be responsible to produce a sensible fingerprint e.g. hash of hostname + env variables, etc.

@hden hden mentioned this issue Jun 12, 2017
Merged
@hden hden closed this as completed in #8 Jun 12, 2017
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