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

Angular Production Build Issue #95

Open
alex-watson-securus opened this issue Jan 15, 2021 · 1 comment
Open

Angular Production Build Issue #95

alex-watson-securus opened this issue Jan 15, 2021 · 1 comment

Comments

@alex-watson-securus
Copy link

Describe the bug
When using flatpickr as a dependency as part of our Angular project, a recent update to this module caused an error when trying to use the component. Forcing the version to an older versions resolves this, but throws an exception in the Chrome window after, and only after, compiling the angular project for 'Production' build rather than a development build.

Reproduction
We use flatpickr as a dependency, which was in the project as ^4.5.6, but this would of course use the most recent patches to 4.6. By using the --configuration=production to build the Angular project, the flatpickr, when loaded into the application page will happen automatically when the flatpickr object is loaded. The exception is thrown and visible in the Chrome Web Console. Without opening however, the flatpicker will unable to interacted with and display only a blank box.

Expected behavior
When we hard-code our package.json to use flatpickr 4.6.6, the picker works as expected. In this scenario, the box is interactable, dates can be selected, etc.

Desktop (please complete the following information

  • OS: Windows
  • Browser: Chrome

Additional context
The error started in December around the time of previous releases. It went unnoticed in our project immediately, but became apparent at the start of this year.

The compiled, uglified code (used pretty print to display) throws an exception on ' e = t', stating e has not yet been defined, which can also been being defined within the rest of the code snippet.

for (let t = 0; t < 12; t++) {
                        if (e = t,
                        void 0 !== n.config.minDate && n.currentYear === n.config.minDate.getFullYear() && e < n.config.minDate.getMonth() || void 0 !== n.config.maxDate && n.currentYear === n.config.maxDate.getFullYear() && e > n.config.maxDate.getMonth())
                            continue;
                        const e = d("option", "flatpickr-monthDropdown-month");
                        e.value = new Date(n.currentYear,t).getMonth().toString(),
@deniszhigalov
Copy link

Describe the bug
When using flatpickr as a dependency as part of our Angular project, a recent update to this module caused an error when trying to use the component. Forcing the version to an older versions resolves this, but throws an exception in the Chrome window after, and only after, compiling the angular project for 'Production' build rather than a development build.

Reproduction
We use flatpickr as a dependency, which was in the project as ^4.5.6, but this would of course use the most recent patches to 4.6. By using the --configuration=production to build the Angular project, the flatpickr, when loaded into the application page will happen automatically when the flatpickr object is loaded. The exception is thrown and visible in the Chrome Web Console. Without opening however, the flatpicker will unable to interacted with and display only a blank box.

Expected behavior
When we hard-code our package.json to use flatpickr 4.6.6, the picker works as expected. In this scenario, the box is interactable, dates can be selected, etc.

Desktop (please complete the following information

  • OS: Windows
  • Browser: Chrome

Additional context
The error started in December around the time of previous releases. It went unnoticed in our project immediately, but became apparent at the start of this year.

The compiled, uglified code (used pretty print to display) throws an exception on ' e = t', stating e has not yet been defined, which can also been being defined within the rest of the code snippet.

for (let t = 0; t < 12; t++) {
                        if (e = t,
                        void 0 !== n.config.minDate && n.currentYear === n.config.minDate.getFullYear() && e < n.config.minDate.getMonth() || void 0 !== n.config.maxDate && n.currentYear === n.config.maxDate.getFullYear() && e > n.config.maxDate.getMonth())
                            continue;
                        const e = d("option", "flatpickr-monthDropdown-month");
                        e.value = new Date(n.currentYear,t).getMonth().toString(),

Hello! I have same problem! I want to know if you solved this problem?

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

No branches or pull requests

2 participants