danielcompton/shadow-exif-bug

★ 0Forks 0ClojureGitHub ↗Compare

README

shadow-cljs - browser quickstart

Reproducing an issue with exifreader starting in Shadow-CLJS 3.0.0:

Running the Example

With Shadow 3.0.0:

$ npm install; npx shadow-cljs watch app

removed 4 packages, changed 1 package, and audited 12 packages in 1s

found 0 vulnerabilities
shadow-cljs - config: /Users/danielcompton/Developer/clojure/shadow-exif-bug/shadow-cljs.edn
shadow-cljs - updating dependencies
Retrieving thheller/shadow-cljs/3.0.0/shadow-cljs-3.0.0-aot.jar from https://repo.clojars.org/
shadow-cljs - dependencies updated
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.jboss.threads.JBossExecutors (file:/Users/danielcompton/.m2/repository/org/jboss/threads/jboss-threads/3.5.0.Final/jboss-threads-3.5.0.Final.jar)
WARNING: Please consider reporting this to the maintainers of class org.jboss.threads.JBossExecutors
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/Users/danielcompton/.m2/repository/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

shadow-cljs - HTTP server available at http://localhost:8020
shadow-cljs - server version: 3.0.0 running at http://localhost:9630
shadow-cljs - nREPL server started on port 64097
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
The required JS dependency "https" is not available, it was required by "node_modules/exifreader/dist/exif-reader.js".

Dependency Trace:
	starter/browser.cljs
	node_modules/exifreader/dist/exif-reader.js

Searched for npm packages in:
	/Users/danielcompton/Developer/clojure/shadow-exif-bug/node_modules

See: https://shadow-cljs.github.io/docs/UsersGuide.html#npm-install

With Shadow 2.28.23:

$ npx shadow-cljs watch app
shadow-cljs - config: /Users/danielcompton/Developer/clojure/shadow-exif-bug/shadow-cljs.edn
shadow-cljs - updating dependencies
shadow-cljs - dependencies updated
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.jboss.threads.JBossExecutors (file:/Users/danielcompton/.m2/repository/org/jboss/threads/jboss-threads/3.5.0.Final/jboss-threads-3.5.0.Final.jar)
WARNING: Please consider reporting this to the maintainers of class org.jboss.threads.JBossExecutors
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.jna.Native in an unnamed module (file:/Users/danielcompton/.m2/repository/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

shadow-cljs - HTTP server available at http://localhost:8020
shadow-cljs - server version: 2.28.23 running at http://localhost:9630
shadow-cljs - nREPL server started on port 63417
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (207 files, 0 compiled, 0 warnings, 1.41s)

Related code

Exifreader runs in Node and Browser JS. It has some code for loading files remotely that switches on whether fetch is available.

My guess is that both branches are being compiled by Google Closure which is causing the issue.

Contributors

danielcompton

Issues