This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-06
Channels
- # announcements (13)
- # aws (3)
- # beginners (10)
- # calva (3)
- # clj-kondo (1)
- # clojure (63)
- # clojure-spec (15)
- # clojure-sweden (1)
- # clojure-uk (6)
- # community-development (2)
- # cursive (32)
- # datomic (20)
- # duct (1)
- # emacs (11)
- # events (1)
- # fulcro (32)
- # keechma (23)
- # luminus (2)
- # reagent (1)
- # ring (1)
- # shadow-cljs (23)
- # spacemacs (5)
- # specter (4)
- # sql (13)
- # tools-deps (16)
- # vim (1)
- # yada (2)
Hm, working on a :npm-module
target, and requiring some JS files from cljs using (:require ["/abs-path-to-js" :as my-js])
. Compiles, but when that js file is evaluated I get a ReferenceError: shadow$provide is not defined
toying around, I added a shadow$provide = {}
, then see another error - the pattern in these re-emitted js files is
shadow$provide.module$foo = function() {...}
module.exports = module$foo
..and module$foo
is not definedI’m getting some weird errors working with js files that depend on other js files https://gist.github.com/mhuebert/6898da15723a26da485a984bc3249022
one example fails at runtime, referencing a variable that isn’t defined except in the other js file. identity$$module$ftest$util
instead of module$ftest$util.identity
the other one fails at compile time:
import * as util from './util'
export const IDENTITY = (x) => util.identity(x)
the direct JS support sort of only works in the browser since it sort of relies on having a shared global scope
yeah. I'm thinking about adding an option that skips the shadow-cljs transpilation of the JS files