Skip to content
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

Support Babel/Typescript "faux modules" as well as native ESM #936

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

mcollina
Copy link
Member

Fixes #935

@mcollina
Copy link
Member Author

@anonrig please verify

@mcollina
Copy link
Member Author

@fox1t maybe you can take a look as well

@anonrig
Copy link
Contributor

anonrig commented Dec 11, 2020

@mcollina I started having seg fault. A pretty vague message, I'll investigate.

sh: line 1:   815 Segmentation fault: 11  node build/index.js

package.json Show resolved Hide resolved
Comment on lines +217 to +222
module.exports.final = final
module.exports.levels = mappings()
module.exports.stdSerializers = serializers
module.exports.stdTimeFunctions = Object.assign({}, time)
module.exports.symbols = symbols
module.exports.version = version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this is any different than the prior code.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js now makes static analysis of your exports and if it finds module.exports it adds them as named export in the ESM context. The result in JS is the same as before, but writing it like this helps module interop!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahahahah <3

@anonrig
Copy link
Contributor

anonrig commented Dec 11, 2020

OK, seg fault was due to another error by couchbase. It seems that this PR fixes the typescript bug. thanks @mcollina 👍

Copy link

@fox1t fox1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions
Copy link

github-actions bot commented Feb 2, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pino fails to load on node 14.15.1 and TS 4.1.2
4 participants