Debugging parcel build
vs parcel serve
issues?
#9469
Replies: 1 comment
-
I got lucky with a random shot in the dark: My app was originally built around Preact, and everything worked fine. I recently started using react-intl, and (after I got it setup correctly) everything worked fine for As an experiment, I switched from Preact to React and... the issue went away. To summarize: Parcel+Preact+react-intl didn't work but Parcel+React+react-intl does work, but I have no idea why. I'm not sure if it's a Preact or Parcel issue--my guess would be Parcel, but I have no idea. In the future, I'll try and create a trivial repro and open an issue. |
Beta Was this translation helpful? Give feedback.
-
I've been using Parcel on a project for a few years, but recently my
parcel build
production builds stopped working (at run-time, not build-time), whileparcel serve
works flawlessly.Does anyone have tips on how to debug issues that only show up with
parcel build
but notparcel serve
?I've tried:
I cranked up the log level and it's logging "Conditional or non-top-level
require()
call" a lot, which I think might be preventing scope hoisting, but I don't think these should prevent the build from working correctly. I suspect this issue is related to TypeScript configuration because it's literally flagging a top-level import as not top-level. But again, I don't think that should prevent anything from working.Specific error info
The error I'm seeing is:
And indeed if I search for
$e21355414fd2bd2a$exports
in my produced index.js, that variable is referenced here:But it's never defined or referenced anywhere else. I think Parcel generates this code, but I'm not sure how it's supposed to work yet.
For what it's worth, I've tracked down the precise change in my code that triggers my issue, but all I'm doing is using an imported component in a new file--something I've been doing all over the place without issue for years now. My best guess is that the issue is related to some ordering in the resulting index.js, but that's just a guess for now.
Beta Was this translation helpful? Give feedback.
All reactions