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

npm_package variables not set when processing cypress/plugins/index.js #524

Closed
max-nextcloud opened this issue Mar 23, 2022 · 6 comments
Closed

Comments

@max-nextcloud
Copy link

We're using a webpack config that makes use of npm_package_name and npm_package_version.

These are not set during the run - which is confusing as it looks like npx is used to run the job.

I'd expect the npm_package_... variables to be set just like when i run npx cypress run locally.

@max-nextcloud
Copy link
Author

Setting the variable in env fixes the failing test.

max-nextcloud added a commit to nextcloud/text that referenced this issue Mar 23, 2022
no idea why but it seems to be undefined.
Reported upstread here: cypress-io/github-action#524

Signed-off-by: Max <max@nextcloud.com>
max-nextcloud added a commit to nextcloud/text that referenced this issue Mar 31, 2022
no idea why but it seems to be undefined.
Reported upstread here: cypress-io/github-action#524

Signed-off-by: Max <max@nextcloud.com>
max-nextcloud added a commit to nextcloud/text that referenced this issue Mar 31, 2022
no idea why but it seems to be undefined.
Reported upstread here: cypress-io/github-action#524

Signed-off-by: Max <max@nextcloud.com>
@skjnldsv
Copy link

skjnldsv commented Jan 6, 2023

Ahaha, I see we had the same issue @max-nextcloud 😢

@MikeMcC399
Copy link
Collaborator

@max-nextcloud

It looks like you were able to resolve your issue.

Can this be closed now?

@MikeMcC399
Copy link
Collaborator

Closing, since this is a stale, inactive issue.

@max-nextcloud
Copy link
Author

It looks like you were able to resolve your issue.

I was able to find a workaround by setting npm_package_name in the env even though it should be set by npx. If i remove the workaround the run still fails: https://github.com/nextcloud/text/actions/runs/6812145616/job/18524231320

Can this be closed now?

Your choice. The issue in the action still is there but a workaround exists.

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Nov 9, 2023

@max-nextcloud

Thanks for responding!

Since v2, the action uses Module API to run Cypress (see CHANGELOG), so at that point neither npm nor npx are involved.

The cypress/plugins/index.js is no longer supported (see Plugins File Removed). This affects all non-legacy versions of Cypress starting with 10.x including the current 13.x version. The repo https://github.com/nextcloud/text, which this issue is linked to, looks like it has already migrated to Cypress 13.x.

So, I would tend to leave this issue closed if you have a workaround which fits your needs. If there is anything which needs investigating, then probably a new issue would be better than re-opening this one, due to migration differences.

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

3 participants