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

Cypress fails on CI (github action) #103

Closed
sergivillar opened this issue Jun 9, 2022 · 11 comments
Closed

Cypress fails on CI (github action) #103

sergivillar opened this issue Jun 9, 2022 · 11 comments
Labels
needs response We need a response from the original author about the issue

Comments

@sergivillar
Copy link

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

Create a new project, deploy it with the github action, it will fails as it seems there's a bug with the latests NPM version.

This is the error

npm ERR! 'npm ci' can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with 'npm install' before continuing.

FYI: I fix this issue changing the node version of the Cypress state to node-version: 16.10.0 (last v7 npm version) and it works.

Expected Behavior

Not fail in the cypress step on github action.

Actual Behavior

Cypress step of the build fails.

@MichaelDeBoey
Copy link
Member

Will probably be fixed by #102

@MichaelDeBoey
Copy link
Member

Closed by #102

@AsaAyers
Copy link

I don't think this fully fixed it 😢 I just created a new project by running npx create-remix --template remix-run/indie-stack and following the readme. npm ci works locally but fails on CI.

image

@AsaAyers
Copy link

This got me past that npm ci error.

index d01b1b0..a45574c 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -100,7 +100,7 @@ jobs:
       - name: 📥 Download deps
         uses: bahmutov/npm-install@v1
         with:
-          useLockFile: false
+          useLockFile: true
 
       - name: 🛠 Setup Database
         run: npx prisma migrate reset --force

@mcansh
Copy link
Contributor

mcansh commented Jun 10, 2022

ah yep, the first run won't have a lock file until the deps are installed due to #79, so npm ci will fail, personally i think it's fine to have them by default and if someone wants to use a diff package manager, they'll know what to do - especially because we still use npm in the Dockerfile

@machour
Copy link
Collaborator

machour commented Jun 10, 2022

@mcansh Could we add some output to the CI about this to avoid confusing users?

@mcansh
Copy link
Contributor

mcansh commented Jun 10, 2022

something like? I'm not sure this is better than just having one by default as we still use npm in the Dockerfile

- name: Check for lockfile
  run: |
    FILE=package-lock.json
    if [ ! -f "$FILE" ]; then
      echo "$FILE does not exist. Please run `npm install` before continuing"
      exit 1
    fi

however! just thought about this, we could potentially check for the package manager in github and pass that to Docker for it to know which files to copy and which PM to use 🤔

@AsaAyers
Copy link

AsaAyers commented Jun 10, 2022 via email

@machour machour reopened this Jun 10, 2022
@mcansh
Copy link
Contributor

mcansh commented Jun 20, 2022

I think by explicitly disabling the lock file, it would check out different versions of packages and then that causes "npm ci" to complain about them being out of sync.

something is definitely up, but i don't think that's it as opting out of the lock file uses npm install and not npm ci

https://github.com/bahmutov/npm-install/blob/master/index.js#L112

@mcansh
Copy link
Contributor

mcansh commented Jun 20, 2022

interesting, i just created a new app and the cypress job passed https://github.com/mcansh/indie-stack-test/runs/6971217149?check_suite_focus=true

@mcansh mcansh added the needs response We need a response from the original author about the issue label Jun 20, 2022
@machour
Copy link
Collaborator

machour commented Jul 11, 2022

Closing this issue as no response was provided.
Feel free to re-open it if it's still a problem.

@machour machour closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs response We need a response from the original author about the issue
Projects
None yet
Development

No branches or pull requests

5 participants