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
{{ message }}
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
I think this may very well be a bug in esm...it's problematic for morgan to address this because the legacy API depends on exports.default pointing to morgan's default format function (which returns a string) rather than the morgan function itself. The warning doesn't happen when using node's experimental-modules flag so it seems like it should be possible for it to work without a warning in esm also, although that's just an educated guess.
Because the code for morgan does not contain the __esModule flag, it seems like esm should be able to realize that exports.default is not the default export of an ES6 module, but rather just a regular export of a CommonJS module that happens to be named default. I took a quick look at the source code in this repo and I see that it is checking for __esModule in a couple places, but maybe there's some additional place that check needs to be added...
Importing
morgan
package triggers deprecation warning due to accessing thedefault
property ofmorgan
import.That property is marked as deprecated in morgan with this code:
It seems that esm triggers deprecation warning on parsing.
Works without warning in 3.2.20. Version 3.2.21 is the first one that gives the warning.
Repro sandbox: https://codesandbox.io/s/esmpropertyaccessbug-8djiv
The text was updated successfully, but these errors were encountered: