-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
formatters.mjs export issue #3744
Comments
That's really helpful, and related to #3670. It definitely looks like a Parcel bug (possibly 2?) and not specific to Plasmo's usage of Parcel. I spent some time troubleshooting (I keep getting nerd-snipped here lol), and I got some additional info: Re-exporting an import also used in the module that imports it breaks Parcel in dev/watch modeBreaks: Lines 3 to 4 in 5c1adb5
Lines 20 to 22 in 5c1adb5
Possible workaround: import { formatters as _formatters } from "./_lib/format/formatters.mjs";
import { longFormatters as _longFormatters } from "./_lib/format/longFormatters.mjs";
...
export const formatters = _formatters;
export const longFormatter = _longFormatters;
|
export { format as formatDate }; |
Possible workaround:
Similarly to the previous issue, assigning to a new constant that is exported seems to fix the problem.
export const formatDate = format;
Other bundlers don't have these problems AFAIK, so it should be reported to the Parcel team.
As demonstrated here, there appears to be workarounds that could be implemented in date-fns. They would not address the root cause though. @kossnocorp
date-fns v3.1.0 and earlier should work, so you can also try downgrading temporarily until this is resolved.
(@seaders this might be of interest to you)
I had this same problem, but was unable to reproduce it in a clean project. Eventually, I deleted my |
Another issue there ( it only occurs in production mode, i.e.
|
Hey! I ran into this same issue after upgrading The real interesting part is that plain javascript works perfectly, but the typescript one fails. Also noticed this PR related to a duplicate export which caused some issues, could be worth keeping an eye out on the effects of that PR getting merged. |
format(new Date(), 'yyyy') results in Uncaught TypeError: _formattersMjs.formatters is undefined
It's simple (almost sample) Parcel v 2.12.0 project with this config in package.json:
The text was updated successfully, but these errors were encountered: