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

Error message running app #2

Closed
kerim opened this issue Apr 11, 2023 · 15 comments
Closed

Error message running app #2

kerim opened this issue Apr 11, 2023 · 15 comments

Comments

@kerim
Copy link

kerim commented Apr 11, 2023

I'm having error messages I don't understand when I try to run the app using "logseq-graph-validator" from within the graph folder, or running "rm -rf .nbb/ && node graph_validator.mjs" from within the app folder. (I was suggested to do the latter by @cldwalker.) Here is what I am seeing. Info about my setup below.

Downloading dependencies...
Extracting dependencies...
Done.
file:///Users/{name of my root folder redacted}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238
Zr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,z,null,1,null),2,null),new $APP.E(null,Xr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,F,null,1,null),2,null),null,1,null),2,null),3,null),4,null),5,null),6,null)):null}finally{$APP.gq()}}).then(function(){var S=$APP.y(a);return Ju.g?Ju.g(S,b):Ju.call(null,S,b)}):Promise.reject(Error(["Could not find namespace: ",$APP.p.h(r)].join("")))}return Promise.resolve($APP.U.h(b))};
                                                                                                                                                                                                                                                                                                                                                             ^

Error: Could not find namespace: logseq.graph-parser.cli
    at Ju (file:///Users/{name of my root folder redacted}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238:350)
    at file:///Users/{name of my root folder redacted}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:647:207
    at async file:///Users/{name of my root folder redacted}/graph-validator/graph_validator.mjs:9:18

Node.js v19.8.1

M1 MacBook Pro (always updated to latest version of MacOS)
borkdude/brew/babashka: stable 1.3.176
yarn: stable 1.22.19 (bottled)
node: stable 19.8.1 (bottled), HEAD

@logseq-cldwalker
Copy link
Collaborator

Hi @kerim. When you run this command find .nbb/.cache/X/nbb-deps/logseq where X is a random id like b34aecd91133fb66d9a99efeb9e3073b9e151750, what do you see? I see:

.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/extract.cljc
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/config.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/whiteboard.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/log.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/cli.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/test
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/test/docs_graph_helper.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/util
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/util/block_ref.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/util/db.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/util/page_ref.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/block.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/schema
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/schema/mldoc.cljc
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/util.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/property.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/text.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/mldoc.cljc
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/utf8.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/graph_parser/date_time_util.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/db.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/db
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/db/rules.cljc
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/db/default.cljs
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq/db/schema.cljs

Having the file ending in graph_parser/cli.cljs is necessary in order for the CLI to work and why you're getting an error. Could you share the output of that command and specify what version (git SHA) of the graph-validator you have cloned?

@kerim
Copy link
Author

kerim commented Apr 14, 2023

find: .nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/nbb-deps/logseq: No such file or directory

@kerim
Copy link
Author

kerim commented Apr 14, 2023

I ran the clone command after the last update. I don't remember the version number. Since it isn't loaded via brew I'm not sure how to check the version?

In the announcement you said it was Release 0.4.0.

@logseq-cldwalker
Copy link
Collaborator

Hmm. What does find .nbb/.cache/*/nbb-deps/logseq give you?

I ran the clone command after the last update. I don't remember the version number. Since it isn't loaded via brew I'm not sure how to check the version?

Nice. It's a recent version so no need

@kerim
Copy link
Author

kerim commented Apr 15, 2023

"no matches found: .nbb/.cache/*/nbb-deps/logseq"

@logseq-cldwalker
Copy link
Collaborator

Sorry but I forgot to document you also need to have clojure installed. With that installed, could you give rm -rf .nbb/ && node graph_validator.mjs another try? If that doesn't work, could you give me the output of find .nbb and bb --config nbb.edn print-deps --format classpath?

@kerim
Copy link
Author

kerim commented Apr 17, 2023

OK, installed, but still getting errors:

Downloading dependencies...
Extracting dependencies...
Done.
file:///Users/{user folder}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238
Zr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,z,null,1,null),2,null),new $APP.E(null,Xr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,F,null,1,null),2,null),null,1,null),2,null),3,null),4,null),5,null),6,null)):null}finally{$APP.gq()}}).then(function(){var S=$APP.y(a);return Ju.g?Ju.g(S,b):Ju.call(null,S,b)}):Promise.reject(Error(["Could not find namespace: ",$APP.p.h(r)].join("")))}return Promise.resolve($APP.U.h(b))};
                                                                                                                                                                                                                                                                                                                                                             ^

Error: Could not find namespace: logseq.graph-parser.cli
    at Ju (file:///Users/{user folder}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238:350)
    at file:///Users/{user folder}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:647:207
    at async file:///Users/{user folder}/graph-validator/graph_validator.mjs:9:18

Node.js v19.9.0

It finds nbb now:

find .nbb
.nbb
.nbb/.cache
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750
.nbb/.cache/b34aecd91133fb66d9a99efeb9e3073b9e151750/deps.edn

But this is still not working:

bb --config nbb.edn print-deps --format classpath
✖ [2023-04-18 07:19:51:535] Error running command. Please check the stacktrace or the help section "bb -h".

✖ [2023-04-18 07:19:51:539] TypeError: command is not a constructor
    at Program.invoke (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:364:5)
    at Program.run (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:196:12)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/bb-cli/bin/bb:29:13)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Module._load (node:internal/modules/cjs/loader:972:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47

@logseq-cldwalker
Copy link
Collaborator

✖ [2023-04-18 07:19:51:539] TypeError: command is not a constructor
at Program.invoke (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:364:5)
at Program.run (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:196:12)

Ah. That's the culprit. bb-cli is an npm lib you installed before installing babashka. You'll need to uninstall that program and make sure that the above bb command works. You may want to start a new shell after uninstalling the program so that babashka's bb is recognized

@kerim
Copy link
Author

kerim commented Apr 19, 2023

Doesn't seem to help. Still getting errors.

rm -rf .nbb/ && node graph_validator.mjs
Downloading dependencies...
Extracting dependencies...
Done.
file:///Users/{home}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238
Zr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,z,null,1,null),2,null),new $APP.E(null,Xr,new $APP.E(null,new $APP.E(null,$APP.xl,new $APP.E(null,F,null,1,null),2,null),null,1,null),2,null),3,null),4,null),5,null),6,null)):null}finally{$APP.gq()}}).then(function(){var S=$APP.y(a);return Ju.g?Ju.g(S,b):Ju.call(null,S,b)}):Promise.reject(Error(["Could not find namespace: ",$APP.p.h(r)].join("")))}return Promise.resolve($APP.U.h(b))};
                                                                                                                                                                                                                                                                                                                                                             ^

Error: Could not find namespace: logseq.graph-parser.cli
    at Ju (file:///Users/{home}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:2238:350)
    at file:///Users/{home}/graph-validator/node_modules/@logseq/nbb-logseq/lib/nbb_core.js:647:207
    at async file:///Users/{home}/graph-validator/graph_validator.mjs:9:18

Node.js v19.9.0

bb --config nbb.edn print-deps --format classpath
✖ [2023-04-19 08:51:24:421] Error running command. Please check the stacktrace or the help section "bb -h".

✖ [2023-04-19 08:51:24:425] TypeError: command is not a constructor
    at Program.invoke (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:364:5)
    at Program.run (/opt/homebrew/lib/node_modules/bb-cli/node_modules/ronin/build/program.js:196:12)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/bb-cli/bin/bb:29:13)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Module._load (node:internal/modules/cjs/loader:972:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47

@logseq-cldwalker
Copy link
Collaborator

logseq-cldwalker commented Apr 19, 2023 via email

@kerim
Copy link
Author

kerim commented Apr 19, 2023

I'm obviously not unstalling it right, but I'm not sure what to do? I ran npm remove bb-cli and didn't get any error message, so I assumed it worked?

@kerim
Copy link
Author

kerim commented Apr 19, 2023

I followed the instructions on this page to install it, but they don't have uninstall instructions: https://www.npmjs.com/package/bb-cli

@kerim
Copy link
Author

kerim commented Apr 19, 2023

I tried npm uninstall as well, but still getting the same error...

@kerim
Copy link
Author

kerim commented Apr 19, 2023

Figured it out! Seems I had used the -global flag in those instructions, so to remove it I needed to use:

npm uninstall -g bb-cli --save

I then needed to uninstall and re-install Babashka with brew. Now things are working. Thanks for your patience!

@kerim kerim closed this as completed Apr 19, 2023
@logseq-cldwalker
Copy link
Collaborator

logseq-cldwalker commented Apr 19, 2023 via email

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