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

Lumo error on require of pinpointer.core #9

Open
arichiardi opened this issue Feb 1, 2018 · 3 comments
Open

Lumo error on require of pinpointer.core #9

arichiardi opened this issue Feb 1, 2018 · 3 comments

Comments

@arichiardi
Copy link

Hi!

I am trying this wonderful library with lumo and I get the following error when I require the main namespace:

Could not require pinpointer.core in file ep_cloud/dev.cljs
	 (new)
	 Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2024:72)
	 Function.cljs.analyzer.error.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2660:92)
	 (NO_SOURCE_FILE <embedded>:5660:320)
	 (Object.lumo.repl.run_sync_BANG_)
	 Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5637:185)
	 Object.cljs.js.process_libs_deps (NO_SOURCE_FILE <embedded>:5640:60)
	 (NO_SOURCE_FILE <embedded>:5658:474)
	 (Object.lumo.repl.run_sync_BANG_)
	 Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5637:185)

Unexpected eval or arguments in strict mode
	 createScript (vm.cljs:80:10)
	 Object.runInThisContext (vm.cljs:152:10)
	 (Object._t)
	 lumo.repl.caching_node_eval (NO_SOURCE_FILE <embedded>:6481:68)
	 (NO_SOURCE_FILE <embedded>:5659:410)
	 (Object.lumo.repl.run_sync_BANG_)
	 Object.cljs.js.process_deps (NO_SOURCE_FILE <embedded>:5637:185)
	 Object.cljs.js.process_libs_deps (NO_SOURCE_FILE <embedded>:5640:60)
	 (NO_SOURCE_FILE <embedded>:5658:474)
	 (Object.lumo.repl.run_sync_BANG_)

Any hint of what that can be?

@athos
Copy link
Owner

athos commented Feb 1, 2018

Hi, @arichiardi

Thank you for reporting the issue :)
That error can be reproduced in my environment too. It looks like the error message is complaining Pinpointer's use of eval, which is necessary for the error analysis and so seems hard to remove it completely from Pinpointer.

Perhaps a quick workaround is to disable Lumo's --use-strict flag for your development time (see here for the details), but I'll dig into it a little more.

@arichiardi
Copy link
Author

Will try that out and report back!

@arichiardi
Copy link
Author

I have tried to have a dev.cljs in a file:

(ns pkg.dev
  (:require
            [cljs.spec.alpha :as s]
            [cljs.test :as test]
            lumo.core
            lumo.repl
            [cljs.spec.test.alpha :as stest]))

(enable-console-print!)

;; https://github.com/anmonteiro/lumo/issues/28
(def v8 (js/require "v8"))
(.setFlagsFromString v8 "--no-use_strict")

;; Trying out a couple of libs for better spec printing
;; (set! s/*explain-out* expound/printer)
(require '[pinpointer.core :as pinpointer])
(set! s/*explain-out* (partial pinpointer/pinpoint-out
                               {:colorize true
                                :eval lumo.core/eval}))

And while this works at the REPL, it does not when loading with the -i file.

Probably something still connected to anmonteiro/lumo#28

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