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 test failing due to snappy update (probably) #96

Open
jonim8or opened this issue Feb 7, 2022 · 1 comment
Open

Cypress test failing due to snappy update (probably) #96

jonim8or opened this issue Feb 7, 2022 · 1 comment

Comments

@jonim8or
Copy link

jonim8or commented Feb 7, 2022

Hi, thanks for the new release. Unfortunately it broke our builds. I don't know what exactly is going wrong, but it seems to be related to snappy, and as the new 6.0.4 release includes a new snappy version that is my main suspect.
I run cypress tests of my project using cypress 6.5.0 and the @cypress/browserify-preprocessor
Since the release of 6.0.4 my cypress_console.log file lists:

Oops...we found an error preparing this test file:

  cypress/support/index.js

The error was:

SyntaxError: Unexpected character '�' (1:2) while parsing /e2e/node_modules/@napi-rs/snappy-win32-x64-msvc/snappy.win32-x64-msvc.node while parsing file: /e2e/node_modules/@napi-rs/snappy-win32-x64-msvc/snappy.win32-x64-msvc.node

This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

- A missing file or dependency
- A syntax error in the file or one of its dependencies

Fix the error in your code and re-run your tests.

We are not using snappy, and are telling browserify to not complain about missing libraries. But I've got the feeling somehow it ended up still including some binary where it shouldn't.

I've already spent too much time trying to find the issue, so for now we will use my fork of this project instead. But I do hope that this bugreport helps finding and solving this problem.

@JaniAnttonen
Copy link
Owner

Definitely feels like a problem that could be fixed by a config change – after all, the snappy dependency is an optional dependency and there should be a way of not depending on those in Cypress.

One, albeit convoluted way of fixing this in the future for good would be to have two separate builds happening automatically with one having the dep and the other not.

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

2 participants