Skip to content

build: use the es6 build for ESM exports#1707

Merged
diesieben07 merged 1 commit intomoment:masterfrom
pataar:patch-1
Jul 9, 2025
Merged

build: use the es6 build for ESM exports#1707
diesieben07 merged 1 commit intomoment:masterfrom
pataar:patch-1

Conversation

@pataar
Copy link
Copy Markdown
Contributor

@pataar pataar commented May 21, 2025

Currently it seems that Metro (from React Native) isn't resolving Luxon correctly due to the incorrect exports configuration.

It seems that ESM imports prefer the source code instead of the built code. Changing this to the es6 build resolves the issue.

This is the error with the old export:
image

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 21, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@nossila
Copy link
Copy Markdown

nossila commented Jun 25, 2025

Related issue on the React repository: facebook/react#33052

@diesieben07
Copy link
Copy Markdown
Collaborator

Honestly this seems like a bug in the React compiler, if it just removes symbols that are used.

However it does make sense in general to not use the source code but the built code anyways, so I'm gonna merge this.

@diesieben07 diesieben07 merged commit cf67025 into moment:master Jul 9, 2025
1 check passed
diesieben07 added a commit that referenced this pull request Jul 9, 2025
@diesieben07
Copy link
Copy Markdown
Collaborator

This has caused problems, so I have reverted it for now until we can figure out what the problem is.
The whole build setup needs an overhaul, which I will tackle soon.

@veliseev93
Copy link
Copy Markdown

Any updates?

@pierpo
Copy link
Copy Markdown

pierpo commented Aug 7, 2025

Hi! I am using 3.7.1 and still have the issue on React Native (Expo 53) 🤔 It looks like the revert was not enough?

Still, I think the real issue here would be to tackle the circular dependency issue itself.

src/impl/zoneUtil.js -> src/util.js -> src/impl/settings.js -> src/impl/zoneUtil.js

Also, here's the error as text so that other people can find it easily (I was not able to find the issue because the error is only in the screenshot 😁 )

isUndefined is not a function (it is undefined)

@diesieben07
Copy link
Copy Markdown
Collaborator

The revert happens because the fix in this PR caused other issues.
Because of that I reverted it, getting us back to the state before this PR so naturally the React Native issue will still exist.
I'm looking in to other ways to improve the bundling in the next minor version before rebuilding it completely for Luxon 4.

@diesieben07
Copy link
Copy Markdown
Collaborator

Hi @pierpo, hi @pataar

I have published a prerelease that should hopefully fix this issue. It would be very kind if you could test with npm install luxon@3.8.0-alpha.1 and let me know if it resolves your issue. Thank you!

@mzaien
Copy link
Copy Markdown

mzaien commented Aug 28, 2025

luxon@3.8.0-alpha.1

@diesieben07 just tried it, the release fixes it 🚀

@diesieben07
Copy link
Copy Markdown
Collaborator

Thank you for confirming!

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.

6 participants