Is there a way to tell shadow to not include a file/flick browser on? The library https://www.npmjs.com/package/object-inspect has a clause in the package.json
"browser": {
"./util.inspect.js": false
},
This file is loaded as shadow is running with browser mode off, but util.inspect.js fails to work correctly in browser (it's designed for node environments).
Importing the util polyfil is doable, but not nice to fix a file that shouldn't be running.
I don't think the :npm resolve is usable here, since it's part of the object-inspect package.Entry keys doesn't seem to have an easy way to make things work like I thought it might
kinda unclear what you are asking here as your description is a bit confusing. seems like a bug in the library if the file it specifies to use for browsers doesn't work in a browser?
ah nvm. read it wrong. the false there should work just fine in shadow-cljs? I mean it should be ignoring the file for :target :browser
works as expected for me, no extra config whatsoever, just the defaults
I'm getting this compilation error:
The required JS dependency "util" is not available, it was required by "node_modules/object-inspect/util.inspect.js".
Dependency Trace:
cubiko/app/container/cubiko/conditional_test.cljs
cubiko/test/utils/component_utils.cljs
node_modules/@testing-library/react/dist/index.js
node_modules/@testing-library/react/dist/pure.js
node_modules/@testing-library/dom/dist/index.js
node_modules/@testing-library/dom/dist/get-queries-for-element.js
node_modules/@testing-library/dom/dist/queries/index.js
node_modules/@testing-library/dom/dist/queries/label-text.js
node_modules/@testing-library/dom/dist/queries/all-utils.js
node_modules/@testing-library/dom/dist/query-helpers.js
node_modules/@testing-library/dom/dist/suggestions.js
node_modules/@testing-library/dom/dist/role-helpers.js
node_modules/aria-query/lib/index.js
node_modules/aria-query/lib/elementRoleMap.js
node_modules/deep-equal/index.js
node_modules/es-get-iterator/index.js
node_modules/stop-iteration-iterator/index.js
node_modules/internal-slot/index.js
node_modules/side-channel/index.js
node_modules/object-inspect/index.js
node_modules/object-inspect/util.inspect.js
Searched for npm packages in:
/home/.../project/node_modules
See: what is your shadow-cljs version and build config?
thheller/shadow-cljs {:mvn/version "3.1.5"}
:npm-deps {:install false}
:build-defaults {:compiler-options {:warnings-as-errors true}}
:builds {
:browser-test {:ns-regexp "(-test$)|(-cards$)"
:target :browser-test
:test-dir "test_runner/browser"
:compiler-options {:static-fns false}}}
:deps truewhich object-inspect version? maybe an older one that doesn't have the browser override? or did you take that from your actual file on your actual disk? not npm or some github repo?
I'm guessing blindly. It works fine for me and not sure why it wouldn't
Npm import. I'll strip it to bare bones tomorrow and see if I can repro it better
hmm nevermind. it works because I still have the util polyfill installed 😛
let me check
doh ... found it
ok should be fine in 3.1.6
You're amazing! Thank you so much!