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

Minified es6/luxon.min.js throws 'not a function or not iterable' for valid fromISO() #1229

Open
steve2507 opened this issue Jul 5, 2022 · 5 comments

Comments

@steve2507
Copy link

Describe the bug

TypeError: n is not a function or its return value is not iterable

Note that this runs perfectly fine with the non-minified es6 version.

To Reproduce
Please share a minimal code example that triggers the problem:

import { DateTime } from 'https://moment.github.io/luxon/es6/luxon.min.js';
console.log(DateTime.fromISO('2019-01-01T05:00:00.000'));

Actual vs Expected behavior

  • Ensure behaviour is consistent between minified and non-minified version.
  • Ensure no error is thrown on valid fromISO formats (although in this case caused by the minifier).

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser: Chrome 103
  • Luxon version: latest
  • Your timezone: Europe/Zurich

Additional context
Add any other context about the problem here.

@icambron
Copy link
Member

icambron commented Jul 9, 2022

Yeah, must be something up with the minifier

@dasa
Copy link
Contributor

dasa commented Jul 11, 2022

In case you did want to switch back to Terser, I noticed a typo at:

topLevel: !opts.global,

topLevel -> toplevel

https://terser.org/docs/api-reference#mangle-options

@debadutta98
Copy link

Hi @icambron, can I take up this issue?

@diesieben07
Copy link
Collaborator

It might be worth investing whether microbundle is a viable option.

@icambron
Copy link
Member

If we do go down the route of adding yet another place where the version string lives, let's be sure to update the release script to check that this additional location is the same as the others. There is already tooling to check that the version in the code matches the one in package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants