shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Henry 2021-02-01T14:45:25.286400Z

IIRC, http://shadow-cljs.org used to have a homepage. It is now linked back to the GitHub repo instead, is it intentional? Also, is the latest docs still the User Guide Version 1.0 dated Jan 10, 2018? Thanks!

thheller 2021-02-01T14:49:18.287200Z

I never bother to update the date on the docs. doesn't mean anything anyways. it is still current. The homepage I'll restore when I have time, not high prio right now

Henry 2021-02-01T15:00:59.289600Z

Excellent to know. The GitHub repo is indeed very resourceful and full of helpful information already. Many thanks for creating and maintaining such a fantastic and important tool.

Ray Stubbs 2021-02-01T17:38:36.292400Z

Hi all, I'm having some difficulty with dynamic module loading. The error returned by the loader doesn't give much info, but pasting the generated js into the console gives me the following. Anybody know how to fix this?

Ray Stubbs 2021-02-01T17:39:12.292700Z

@isak

hadils 2021-02-01T17:45:36.295400Z

Hi. I loaded a react native npm package and its peer dependencies into my project. They are present in my package.json file and my require is correct, but

[:> ls/LoginScreen]
returns
[:> nil]
I am wondering if using Expo SDK 40 and react 17.0.0 might be causing this problem. Any thoughts?

thheller 2021-02-01T18:08:22.295700Z

@hadilsabbagh18 what is ls? what is your require? read the section about :default, maybe thats it https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages

thheller 2021-02-01T18:10:53.296Z

could be related to how you are loading the files. pasting code into the console is not something you should be doing

Ray Stubbs 2021-02-01T18:13:20.296200Z

Not a familiar issue then huh? Yeah the pasting was a last attempt to get some useful error info (maybe it's misleading though?), the actual error returned by the loader just says... 1.

thheller 2021-02-01T18:14:29.296400Z

it could be polyfill problems. try deleting .shadow-cljs/builds/<build-id>/dev and rebuild

thheller 2021-02-01T18:14:47.296600Z

but diagnosing things by loading it in the console is making things harder not easier

thheller 2021-02-01T18:15:11.296800Z

the loader you can easily skip by just making a HTML file and putting script tags after each other for all the files it is supposed to load

thheller 2021-02-01T18:15:14.297Z

in the correct order of course

thheller 2021-02-01T18:15:26.297400Z

but no need to use the loader

hadils 2021-02-01T18:15:48.298Z

@thheller Sorry

(require '["react-native-login-screen" :as le])

thheller 2021-02-01T18:16:32.298400Z

I don't know the package but it might be :default LoginScreen

hadils 2021-02-01T18:19:07.298600Z

Ok let me try that.

hadils 2021-02-01T18:22:57.299100Z

That works! Thanks a lot @thheller!!!

Ray Stubbs 2021-02-01T18:25:09.299200Z

It's only happening in a prod environment unfortunately, so deleting the build files probably won't help... though it may be worth looking into whether those are cleared on the server before each build. Copying into a script tag is probably worth trying too, but putting the code into the original html file won't work, since it's not a dev environment. Anyway, thanks for the help, I'll continue to play around with it.

Ray Stubbs 2021-02-01T22:03:59.299800Z

Thanks for the help @thheller, your suggestion of clearing the .shadow-cljs let me repro the issue locally, turned out to be a bug in an outdated version of shadow-cljs.