metafizzy / metafizzy/fizzy-ui-utils

window -> global breaks normal behavior

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
45
Forks
12
PR merge metrics
No merged PRs in 30d

Description

## Issue
Upgrading to latest version of fizzy-ui-utils breaks normal behavior when bundling with parcel's latest version (2.3.2).

When building in production mode
`Uncaught TypeError: e is undefined`

When building in dev mode
No error but slider behaviour is wrong (see image)
![image](https://user-images.githubusercontent.com/35430441/157247170-13b5e057-39c6-47a4-9b17-af703c85028b.png)

As you can see dots disapeared and all slides appart from the 1st one is invisible with flickity-fade

## Reproduction
```
npm i flickity@3.0.0
npm i flickity-as-nav-for@3.0.0
npm i flickity-fade@2.0.0
npm i --save-dev parcel@2.3.2
```
Then init a flickity basic slider with the fade like this
```
let flkty = new Flickity(cells_container, {
lazyLoad: 3,
wrapAround: true,
fade : true,
adaptiveHeight: true,
initialIndex: -1,
prevNextButtons: false,
autoPlay: true
});
```

p.s: I have fixed the `Uncaught TypeError: e is undefined` when building in production by changing the `this` to `global` in fizzy-ui-utils code.

Downgrading to `flickity-fade@1.0.0` fixes the issues but then you need 2 `fizzy-ui-utils` versions

Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with flickity@3.0.0, flickity-as-nav-for@3.0.0, flickity-fade@2.0.0, and Parcel 2.3.2 using the configuration shown. Inspect the fizzy-ui-utils code around the `this` versus `global` behavior, then verify that production builds no longer throw and that development sliders retain their dots and visible slides.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.