"Cannot convert ECMASCRIPT_2018 feature" when importing `test-util.dom-testing`
Closed this issue · 1 comments
When I require the reacl-c.test-util.dom-testing
namespace I get the following errors:
The required JS dependency "@testing-library/dom" is not available, it was required by "reacl_c/test_util/dom_testing.cljs".
Dependency Trace:
app/code.cljs
reacl_c/test_util/dom_testing.cljs
Searched for npm packages in:
/Users/kehrin/Projects/thesis/test/test-rendering-import/node_modules
See: https://shadow-cljs.github.io/docs/UsersGuide.html#npm-install
after manually installing the dependency with npm i @testing-library/dom
I get a similar error telling me that @testing-library/react
is missing:
The required JS dependency "@testing-library/react" is not available, it was required by "reacl_c/test_util/dom_testing.cljs".
Dependency Trace:
app/code.cljs
reacl_c/test_util/dom_testing.cljs
Searched for npm packages in:
/Users/kehrin/Projects/thesis/test/test-rendering-import/node_modules
See: https://shadow-cljs.github.io/docs/UsersGuide.html#npm-install
After also installing that dependency I get this error:
Closure compilation failed with 1 errors
--- node_modules/pretty-format/node_modules/ansi-styles/index.js:131
Cannot convert ECMASCRIPT_2018 feature "RegExp named groups" to targeted output language.
Versions:
clojure 1.10.3
clojurescript 1.10.896
reacl-c 0.10.6
Is there anything I can do to fix this?
A repo with this just this bug: https://github.com/marlonschlosshauer/reacl-c-test-util-dom-testing-error
Hi,
oh, I'm very sorry for missing this for so long. Excellent report, I appreciate your effort.
For the contents:
-
Executing just 'npm install' should install everything needed. Afaik it is intended by shadow-cljs, that it does not do that by itself. I was able to compile your example after that.
-
ECMASCRIPT_2018 - weird that I haven't seen this in any of our projects yet, but the shadow-cljs option
:compiler-options {:output-feature-set :es2018}
fixed it for me in your example project. (See https://shadow-cljs.github.io/docs/UsersGuide.html#_output_language_options)