quasarframework / quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
https://testing.quasar.dev
MIT License
180 stars 65 forks source link

Using Quasar plugins into Cypress directly (not via $q) doesn't work on webpack #257

Closed IlCallo closed 1 year ago

IlCallo commented 2 years ago

When using webpack builds, using Dialog.create won't work apparently because the related Quasar instance doesn't appear to be initialized.

I think it may be due to having both CJS and ESM builds of the package

Eg. Cypress initialize a Quasar instance with installQuasarPlugin and somewhat ends up using the CJS build, then uses the ESM one during execution and both Quasar instance and plugin instances at that point aren't available.

It works when using $q = useQuasar(); $q.dialog(), probably because it actually uses the same instance in that case? I think it works with Vite because it only uses the ESM build

Those are just ideas, I could not pin-point when the problem started, I recall it worked fine when I first added Vite support, but rolling back Quasar and Cypress versions did not help in my tests

IlCallo commented 2 years ago

This doesn't seem to work anymore into Vite, but into 4.2 it seems to work Webpack (eg at least for Dark plugin) It's definitely something related to ESM/CJS build difference

IlCallo commented 1 year ago

I apparently solved this at some point, but then forgot to close it