This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-18
Channels
- # announcements (3)
- # babashka (13)
- # beginners (28)
- # biff (12)
- # clj-yaml (13)
- # clojure (13)
- # clojure-europe (2)
- # clojure-norway (11)
- # clr (1)
- # core-typed (3)
- # datahike (1)
- # datascript (5)
- # datomic (12)
- # fulcro (8)
- # graalvm (8)
- # hyperfiddle (20)
- # missionary (8)
- # off-topic (20)
- # pedestal (1)
- # releases (2)
- # shadow-cljs (12)
- # yamlscript (7)
react-uswds "ReferenceError: jsxRuntime is not defined"? I followed the shadow-cljs quick-start, with only a println in the init fn, and all was well. shadow.cljs lists no dependencies. Then I added "@trussworks/react-uswds": "^9.0.0"
to package.json, and 1 :require clause, ["@trussworks/react-uswds" :refer [Alert]]
. Now the program dies with the cited ReferenceError in the browser console and does not execute the println in init.
Perhaps the require clause is wrong? The model given by https://github.com/trussworks/react-uswds is import { Alert } from '@trussworks/react-uswds'
. That page also has a whole lot of incomprehensible mumbo jumbo about peer dependencies. I see react, react-dom among many other things in node_modules. There is even node_modules/react/jsx-runtime.js! But throughout the node_modules directory tree, the only occurrences of the word jsxRuntime are in in react-uswds. I tried downgrading React to 17.0.2 but the error is the same. ?
the require is correct, otherwise it would have failed at compile time. this is a runtime error, so for some reason the package is unhappy at runtime
Oh well! Thank you for the sanity check. The jsxRuntime reference is found in node_modules/@trussworks/react-uswds/lib/index.iife.js node_modules/@trussworks/react-uswds/lib/index.umd.cjs Which are referenced by package.json under "exports".
ok, shadow-cljs by default will pick the "browser"
export since that in every other package I have seen is usually the commonjs export
so it expects these to be available as globals, rather than referenced packages. jsxRuntime,React,FocusTrap,ReactDOM