You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have a project using Parcel2+react+typescript+mobx, and builds were fine with
mobx-react:7.0.0
(and dependencymobx-react-lite:3.0.1
).However, after upgrading to
mobs-react:7.0.4
andmobx-react-lite:3.1.5
, production builds contain what looks like invalid JS output.As an example, I created this repository: https://github.com/evilfer/mobx-react-lite-test-build.
In there, https://github.com/evilfer/mobx-react-lite-test-build/blob/master/dist-mf704-mrl315/mrl.a6b78398.js is the JS output with
mobs-react:7.0.4
andmobx-react-lite:3.1.5
. The output includes in four places this code:{}()
which fails to run with error "{} is not a function".The same project build with versions
mobx-react:7.0.0
andmobx-react-lite:3.0.1
has correct output https://github.com/evilfer/mobx-react-lite-test-build/blob/master/dist-mr700-mrl301/mrl.5d4eb783.js, without any case of{}()
.I believe the way the
{}()
bits are generated are:Somehow the import doesn't work as expected, and
isUsingStaticRendering
ends up being{}
in the compiled code.The reason is probably related to a change in the export in
mobx-react-lite
:Object.defineProperty(exports, "isUsingStaticRendering"
exports.isUsingStaticRendering = staticRendering_2.isUsingStaticRendering;
I know the change that causes the issue is not in Parcel, but I wonder whether Parcel should be able to work with the updated version.
(Note: ticket in the mobx repo: mobxjs/mobx#2609 (comment))
Beta Was this translation helpful? Give feedback.
All reactions