RobbieTheWagner / ember-flatpickr

An Ember addon that wraps the Flatpickr date picker
https://RobbieTheWagner.github.io/ember-flatpickr/
MIT License
109 stars 55 forks source link

Issue added by version 5.0.0 #1977

Closed villander closed 7 months ago

villander commented 8 months ago

When you update from version 4.x to 5.0.0 using Ember.js 5 you'll see a weird issue in the acceptance tests that use setFlatpickrDate helper

image
RobbieTheWagner commented 8 months ago

Hmm, thanks for letting me know @villander! Does flatpickr otherwise work fine for you and is just a testing issue?

villander commented 8 months ago

Yes, @RobbieTheWagner it's just a testing issue for acceptance tests, for the component tests we're good. I see this repo does not have acceptance tests which made this issue pass through the last release without notice.

RobbieTheWagner commented 8 months ago

Yes, @RobbieTheWagner it's just a testing issue for acceptance tests, for the component tests we're good. I see this repo does not have acceptance tests which made this issue pass through the last release without notice.

Interesting, I am not sure what might be happening. Would you possibly be able to add a basic acceptance test that reproduces the issue?

AmauryD commented 7 months ago

I've encountered the same problem in one of my apps, will take a look into it soon.

AmauryD commented 7 months ago

Don't have a lot of time atm, but i least i have a quick fix @villander .

Seems to be related to @ember/test-helpers. We're currently using version 2.7, which is causing issues. Works fine with 3.x.

A temporary fix is to pin "@ember/test-helpers" to version 3.x.

My PNPM overrides:

  "pnpm": {
    "overrides": {
      "@ember/test-helpers": "^3.2.1"
    }
  },
RobbieTheWagner commented 7 months ago

@AmauryD would updating to 3.x here fix that then? https://github.com/RobbieTheWagner/ember-flatpickr/blob/main/ember-flatpickr/package.json#L45

AmauryD commented 7 months ago

@AmauryD would updating to 3.x here fix that then? https://github.com/RobbieTheWagner/ember-flatpickr/blob/main/ember-flatpickr/package.json#L45

I tried, but we lose compatibility with Ember 4.4. Actually, this release is unsupported since May 2023. Should we drop the support or do we need to investigate further ?

villander commented 6 months ago

@RobbieTheWagner this issue wasn't fixed with this latest release. It's failing for "@ember/test-helpers": "3.3.0". Could you please reopen it?

https://github.com/RobbieTheWagner/ember-flatpickr/issues/1977#issuecomment-1919959722

cc @AmauryD

AmauryD commented 6 months ago

Can you provide an example repo or more details ? The problem is fixed using version 7 in my packages

AmauryD commented 6 months ago

The actual problem seems to be a mismatch between the app and the addon in @ember/test-helpers versions. If you match exactly the version of the addon (^3.0.0) it should work. What's your @ember/test-helpers version ?

RobbieTheWagner commented 6 months ago

I suspect the issue is fixed but perhaps you need to run pnpm dedupe @ember/test-helpers in your monorepo or something @villander. Can you try that?

villander commented 6 months ago

After dedupe, it made things worse @RobbieTheWagner breaking the build

Build Error (PackagerRunner) in node_modules/.pnpm/ember-animated@2.0.0_@babel+core@7.23.9_@ember+test-helpers@3.3.0_@glint+environment-ember-lo_73frxrh6fy5tz2g552pkrytcqi/node_modules/ember-animated/dist/-private/bounds.js

Module build failed (from ../../../../../../../../Users/villander/Projects/project/web-ui/node_modules/.pnpm/thread-loader@3.0.4_webpack@5.90.3/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 3)
$TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-animated@2.0.0_@babel+core@7.23.9_@ember+test-helpers@3.3.0_@glint+environment-ember-lo_73frxrh6fy5tz2g552pkrytcqi/node_modules/ember-animated/dist/-private/bounds.js/bounds.js: Static class blocks are not enabled. Please add `@babel/plugin-transform-class-static-block` to your configuration.
RobbieTheWagner commented 6 months ago

After dedupe, it made things worse @RobbieTheWagner breaking the build


Build Error (PackagerRunner) in node_modules/.pnpm/ember-animated@2.0.0_@babel+core@7.23.9_@ember+test-helpers@3.3.0_@glint+environment-ember-lo_73frxrh6fy5tz2g552pkrytcqi/node_modules/ember-animated/dist/-private/bounds.js

Module build failed (from ../../../../../../../../Users/villander/Projects/project/web-ui/node_modules/.pnpm/thread-loader@3.0.4_webpack@5.90.3/node_modules/thread-loader/dist/cjs.js):

Thread Loader (Worker 3)

$TMPDIR/embroider/2012c7/node_modules/.pnpm/ember-animated@2.0.0_@babel+core@7.23.9_@ember+test-helpers@3.3.0_@glint+environment-ember-lo_73frxrh6fy5tz2g552pkrytcqi/node_modules/ember-animated/dist/-private/bounds.js/bounds.js: Static class blocks are not enabled. Please add `@babel/plugin-transform-class-static-block` to your configuration.

Looks like an ember-animated issue. I definitely think something with all your dependencies is causing the issue.