Closed MuckT closed 1 year ago
@mfrachet when I update the import of lightHouseLib to .cjs
in the examples/cra-authenticated/node_modules/@cypress-audit/lighthouse/src/task.js
the tests are passing locally.
@mfrachet is there a way the tests can use the local version of cypress-audit
instead of the latest version on npm in the CI checks? This might make future PR's easier to contribute.
npm run bootstrap
should do the trick with lerna and its workspaces (at the root of the project)
@mfrachet ended up using relative imports in the example to make e2e testing easier with changes in 74e20476f19167ba60c16fa78633718a6017e179.
It has not worked with the workspaces?
Can you try the following pleas (using module imports) at the root:
rm -rf ./**/node_modules
npm install
npm run bootstrap
and tell me if the workspace module resolution is working?
@mfrachet I think I am getting the version 1.4.0 of cypress-audit in the tests if run the above commands run then run the tests locally.
Error [ERR_REQUIRE_ESM]: require() of ES Module /repos/cypress-audit/examples/cra-authenticated/node_modules/lighthouse/core/index.js from /repos/cypress-audit/examples/cra-authenticated/node_modules/@cypress-audit/lighthouse/src/task.js not supported.
Instead change the require of index.js in /repos/cypress-audit/examples/cra-authenticated/node_modules/@cypress-audit/lighthouse/src/task.js
Arg, you're PR works for me locally using the lerna bootstrap command, something weird is happening
I'll revert those changes. It looks like a bunch of package-lock.json files got updated in doing so. Is that expected?
@mfrachet looks like those changes are failing in CI.
I just moved to pnpm + lerna in https://github.com/mfrachet/cypress-audit/pull/214 and cherry picked your changes regarding the commonjs fix. Let's cross the fingers that people using ESM will not inc too soon :p
Thanks for your help and patience on this one 🙏🏻 . I will merge the pnpm thing and iterate from there
Description
A follow up PR to fix #209 to use the
.cjs
import.Fixes: #207