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
Update: Narrowing this down further, it looks like this is caused by the interaction of @babel/preset-env and @parcel/babel-preset-env in .babelrc. I'm not sure how/why I ended up with both of those in there, but removing the former fixes the problem in the SSCCE here. However doing so in the actual project where I ran into this is causing other issues, so I'm going to leave this open for the time being.
Well, the other problem went away after removing @babel/preset-env from .babelrc, and then doing rm -fr .parcel-cache node-modules package-lock.json && npm install. 'Not sure what was going on there. 馃し
I'm going to leave this open because...
Bugs that only occur during the build process quickly undermine the trust-worthiness of a bundler.
The pain of diagnosing this was pretty high. The error message and stack were completely detached from what was actually causing the problem. This necessitated a lot of trial-and-error debugging, with a lot of waiting around for the build process to run.
The bug occurs deep inside the boilerplate code injected by Parcel/Babel. I'm pretty sure there's a check that can be added somewhere to help surface this earlier and with a more relevant error message.
馃悰 bug report
[Similar issue as reported in #4559 and #5525. Opening a new report, with attached SSCCE]
It appears that certain template string patterns will break
parcel build
, causing the above error (but not break with the dev server).馃捇 SSCCE
See attached
parcel_bug.zip
for minimal, reproduceable, and verifiable example. Unzip and install as follows...
Now do ...
... and open browser to http://localhost:1234 .
Note: No errors in developer console (works as expected)
Next, do...
... and open browser to http://localhost:9080.
Note: "Uncaught TypeError: Object.defineProperty called on non-object" appears in console.
Discussion
This appears to be triggered by the tagged template strings in imported modules. For example...
function simplur() {...}
in index.js (so index.js doesn't have to import simplur), the error goes away.馃實 Your Environment
The text was updated successfully, but these errors were encountered: