reagent

Sam Ritchie 2022-12-09T17:38:59.753519Z

hey all - is there some way to get my reagent project to NOT use the minified production version of react?

Sam Ritchie 2022-12-09T17:39:06.259989Z

I am seeing some errors that I am having a lot of trouble debugging

Sam Ritchie 2022-12-09T17:39:15.278789Z

coming from react…

Sam Ritchie 2022-12-09T17:39:44.533629Z

but this only happens on the first page load after I rebuild the javascript, EVEN THOUGH the browser is not caching main.js ??

Sam Ritchie 2022-12-09T17:40:40.796669Z

with source maps:

lilactown 2022-12-09T17:40:58.742979Z

depending on what build tool you're using, you can provide different files for your JS dependencies

lilactown 2022-12-09T17:41:06.672719Z

is this after a release build?

Sam Ritchie 2022-12-09T17:41:40.469989Z

yeah

Sam Ritchie 2022-12-09T17:42:01.417919Z

but only on the first load, once I serve the file with http-server. it doesn’t seem to happen on first load at , where I’ve deployed the file, either

Sam Ritchie 2022-12-09T17:42:10.989349Z

so it’s a transient local thing? but I don’t get how that could be happening with no caching of the file

lilactown 2022-12-09T17:42:45.004909Z

I do see G is not a function in my console when I visit that URL

Sam Ritchie 2022-12-09T17:42:59.043779Z

if you reload does it persist?

lilactown 2022-12-09T17:44:07.747589Z

I also see an error Cannot read properties of null (reading 'create') above it

Sam Ritchie 2022-12-09T17:44:21.605389Z

yeah, I fixed that, that was a separate issue

lilactown 2022-12-09T17:44:24.580109Z

I don't see it after I reload the page

Sam Ritchie 2022-12-09T17:44:25.278679Z

just haven’t deployed yet

Sam Ritchie 2022-12-09T17:44:30.558839Z

I also don’t see it on safari, just on brave

Sam Ritchie 2022-12-09T17:45:19.781589Z

interesting… so if I DON’T regenerate the file, but simply restart the http-server, then I get that failure again

Sam Ritchie 2022-12-09T17:53:40.755829Z

oh, I think I’ve pinned down what’s going on

lilactown 2022-12-09T17:53:46.441329Z

I can pretty reliably trigger the error if i open the page without devtools opened in Chrome

lilactown 2022-12-09T17:54:12.340279Z

Close devtools -> reload -> open devtools -> observe error

Sam Ritchie 2022-12-09T17:54:53.597309Z

it is happening when I try and interact with this defonce form:

Sam Ritchie 2022-12-09T17:55:18.746949Z

all of this code is actually running inside of an sci environment, so something suspicious is happening here

Sam Ritchie 2022-12-09T17:57:45.166679Z

okay, I fixed it by renaming that atom. this feels like something with sci

Sam Ritchie 2022-12-09T17:57:50.055669Z

thanks for staring with me!

Sam Ritchie 2022-12-09T18:51:17.216019Z

@lilactown I figured it out… I was using a useEffect hook and had a code path that returned nil from my mount function, instead of an unmount function.

🎉 1
lilactown 2022-12-09T20:40:38.759129Z

#helix solves this out of the box for you 😉

❤️ 1
Sam Ritchie 2022-12-09T18:51:39.276059Z

looks like in react 18, with advanced compilation, that triggered a bug