Fork me on GitHub
#shadow-cljs
<
2020-08-18
>
Josh Horwitz03:08:47

hey all, anyone know what this is ?

Can't find 'shadow.cljs.devtools.cli' as .class or .clj for lein run: please check the spelling.
Syntax error (FileNotFoundException) compiling at (/private/var/folders/z3/xn3w5qfj4cz854tgqrbgl9xc0000gn/T/form-init10942131942141271474.clj:1:126).
Could not locate shadow/cljs/devtools/cli__init.class, shadow/cljs/devtools/cli.clj or shadow/cljs/devtools/cli.cljc on classpath.

timrichardt06:08:43

Guten Morgen.

timrichardt06:08:50

I am running into a problem with advanced optimization. I have a project with js and cljs code https://github.com/timrichardt/jsx-cljs-template

> npx shadow-cljs release app
shadow-cljs - config: /Users/tim/jsx-cljs-template/shadow-cljs.edn
[:app] Compiling ...
Closure compilation failed with 3 errors
--- Component.js:2
Cannot import Closure files by path. Use either import goog:namespace or goog.require(namespace)
.... [2 more errors of this type]

timrichardt06:08:23

This is what the import statements of Component.js look like.

//
import * as React from "react";
import StateProvider from "./StateProvider";
import { useStateValue } from "./StateProvider";
import defaultState from "./defaultState";
import Example2 from "./Component2";

thheller08:08:24

@joshua.d.horwitz looks like you don't have the thheller/shadow-cljs dependency declared in project.clj?

👍 3
nitaai08:08:28

hi. i am having troubles with source maps. devtools in chrome are trying to get them from wrong path, i.e. relative to the current url. it should already be fixed here (https://github.com/thheller/shadow-cljs/issues/747). i am using version 2.10.21. anyone else having this issue?

darwin08:08:09

I confirm that the bug was fixed, you must be seeing something else.

thheller08:08:36

@matuskmit1 when asking if anyone else is seeing something it is helpful describing what you are actually seeing 😛

nitaai08:08:58

when i am on /app/borrow/models/1aabaeb8-c1a5-5c8e-858a-aa0bddf469dd, devtools try to get the source maps from /app/borrow/models/js/cljs-runtime/better_cond.core.js.map, instead from /app/borrow/js/cljs-runtime/better_cond.core.js.map. notice the /models/ part. my config file is here: https://github.com/leihs/leihs-borrow/blob/mk/feat/booking-calendar/shadow-cljs.edn

thheller08:08:56

looks like :asset-path "js" is incorrect then? should be :asset-path "/app/borrow/js"?

nitaai08:08:42

no, then i get /app/borrow/models/app/borrow/js/cljs-runtime/better_cond.core.js.map. besides that everything else works just fine based on my config…

nitaai08:08:20

wait, let me restart everything and try again.

thheller08:08:26

note the leading slash ... without that it will not work

nitaai08:08:44

yes, that’s the point. now it seems to work 😄

👍 3
nitaai08:08:46

why everything else was working with an incomplete path is another question though, but already happy

thheller08:08:52

the path pretty much is only relevant for source maps and if you use :module-loader (which you are not)

nitaai08:08:46

oh ok :thumbsup:

tony.kay16:08:19

@thheller seems like #env stopped working somewhere after .12

tony.kay16:08:02

no #shadow/env either:

===== ERROR =================
Failed to read config file: /Users/tonykay/fulcrologic/ucv/shadow-cljs.edn
[line 86, col 141] No dispatch macro for e.
when it reaches #env or #shadow/env

tony.kay16:08:42

seems like a problem with the npm command…I can run .21 via the .12 npm command

thheller17:08:24

@tony.kay it was caused by a bug in tools.reader. its already fixed in master just didn't cut a new release yet since I want to finish something else. https://clojure.atlassian.net/projects/TRDR/issues/TRDR-62

thheller17:08:40

problem is with env vars that aren't set

thheller17:08:14

you can do #shadow/env ["FOO" "defaultVal"] so #shadow/env ["FOO" ""] would be the same behavior as before I think

👍 3
Daniel Slutsky21:08:41

Hi all! I am enjoying shadow-cljs these days, but now started running into a problem: It seems that the compilation result of shadow-cljs compile app is different from that of shadow-cljs watch app. By looking into their behaviour, it seems to me that the compile result is somehow reverting to some old version, possibly cached somewhere. Does anybody know of a possible common reason for that? (Here is my project: https://github.com/scicloj/gorilla-notes/blob/2821701/shadow-cljs.edn) 🙏

Daniel Slutsky22:08:17

(Removing the .shadow-cljs cache subdirectory does not fix that.)

Daniel Slutsky22:08:46

🌴 Interesting. Removing all the compiled code did fix that. 🌴

dpsutton23:08:26

Not sure if it’s part of your problem but I would remove those compiler options setting the compilation optimizations