v0.71.0 builds broken
Builds from 0.70.1 work but not in v0.71.0. The error when I load the page:
The culprit:
24 Replies
how are you building it atm btw? What's the full flag? Try building with minifcation on - I just want to verify that the ASCII minifier is functioning as expected :-?...
I enabled the
--no-minify
flag so that it would point to the correct line of code. It happens with or without that flag
Here is the full command I use: plasmo build --source-maps
@nahtnam btw I assume that package came from react-query from TanStack right?
which version of it are you using
Not sure which one
Can you do a
pnpm why match-sorter-utils
seems to come from react-query-devtools
can you give me a snippet of how querydevtools is being used?Hmmm
And I just render
<DevSettings
at the bottom of my app (not conditionally)
BTW dev worksis
isDev
cached value of process.env.NODE_ENV
?Little trickier than that
env.ts
I have the
PLASMO_PUBLIC
prefix because its required by the library
But you can see at the bottom it's mapped to process.env.NODE_ENVtry using
process.env.NODE_ENV
directly
(just to see if it can prune that ReactQueryDevtools
Changed to
Still have the issue
runtime env var rehydration like this will likely tamper with the code pruning BTW, but this is unrelated
Oh like in the
DevSettings
itselfAhh
Changed to
if (process.env.NODE_ENV === 'production') return null;
, didnt help, let me try with it conditionally rendering the componentWill have a patch for you soon
apparently the new minifier (based on SWC) doesn't normalize UTF8
Gotcha
For the record,
{process.env.NODE_ENV === 'development' && <DevSettings />}
doesnt work either
BTW I think this means im bundling the react devtools into my prod build which is not ideal eitheryup
if you do if and else
does it work?
ref: https://parceljs.org/features/production/#development-branch-removal
Oh, and try it with
--hoist
Isn't this the same thing/better?
{process.env.NODE_ENV === 'development' ? <DevSettings /> : null}
Doesnt work
interesting
react-dev-tool already handled dev env:
So on my end, I was able to just do
pnpm build --hoist
, and simply do this:
Does it work without
hoist
(idk what hoist does)
https://discord.com/channels/946290204443025438/1071728581748719646/1071728581748719646
I disabled hoist ^ because of this issueyo sorry had to step out for a bit. hoist basically move all the dependency to the top of your bundle to make tree shaking more efficient
Interesting, so with
hoist
did you get the error with the UTF8 stuff?Without it I'm still getting the utf8 key
with it, the prod build correctly strip out the devtool xD
Hmm so looks like I need hoist but hoist doesnt work with the remote code injection thing
but yeah it would also ruin your remote code injection
can you try assigning the remote injection into some variable
and then maybe do some kind of variable assignment on it just to trick the hoister to include the remote code?
Hmmm...
I'm inspecting the prod and the dev bundle
Not sure what the heck's going on with prod build that cause those matches to be borked lol
Got a fix for the utf8 issue - apparently if I tell the minifier to keep ascii_only, it aggressively mangle those strng somehow lol
tho, to actually discard the devtool, hoisting will be needed @nahtnam xd...
without hoist, the prod bundle would include that component..
Solution
This was resolved in 0.71.1, thank you!