Skip to content

fix: default condition should be last one#629

Merged
lerouxb merged 1 commit intomongodb-js:mainfrom
talg1:switch-default-position
Mar 27, 2026
Merged

fix: default condition should be last one#629
lerouxb merged 1 commit intomongodb-js:mainfrom
talg1:switch-default-position

Conversation

@talg1
Copy link
Copy Markdown
Contributor

@talg1 talg1 commented Mar 26, 2026

Description

Open Questions

Checklist

@nirinchev
Copy link
Copy Markdown
Collaborator

Can you explain a bit what problem are you facing?

@talg1
Copy link
Copy Markdown
Contributor Author

talg1 commented Mar 26, 2026

When using a NextJS project using webpack, Node requires that "default condition should be last one".

https://stackoverflow.com/questions/76127288/module-not-found-error-default-condition-should-be-last-one

I used version 4.4.3 of mongodb-query-parser in my project, and it seems like the newest version also has the same order. Fixing it locally in node_modules worked for me.

@talg1
Copy link
Copy Markdown
Contributor Author

talg1 commented Mar 26, 2026

https://nodejs.org/api/packages.html

In the conditional exports tab, "default" should always come last according to their docs.

Copy link
Copy Markdown
Member

@lerouxb lerouxb left a comment

Choose a reason for hiding this comment

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

Thank you for this contribution! It looks like you are correct indeed.

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 78.312%. remained the same
when pulling b2bb959 on talg1:switch-default-position
into 2d1269d on mongodb-js:main.

@lerouxb lerouxb merged commit cb4f99f into mongodb-js:main Mar 27, 2026
34 checks passed
@talg1 talg1 deleted the switch-default-position branch March 27, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants