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

Not working with Cypress, webpack, swc-loader and @swc/core 1.3.39 and 1.3.40 #200

Closed
MattyBalaam opened this issue Mar 14, 2023 · 8 comments · Fixed by #212
Closed

Not working with Cypress, webpack, swc-loader and @swc/core 1.3.39 and 1.3.40 #200

MattyBalaam opened this issue Mar 14, 2023 · 8 comments · Fixed by #212

Comments

@MattyBalaam
Copy link

MattyBalaam commented Mar 14, 2023

We have attempted to upgrade from @swc/core from 1.3.38 to 1.3.39 and 1.3.40 but are now getting some compilation errors. If I remove the plugin from experimental.plugins then it runs

Screenshot 2023-03-14 at 13 32 26

@MattyBalaam
Copy link
Author

As a side-note I’ve attempted to run the tests in this repo. But it’s my first time running Rust and I’m not sure what I am doing. I kept getting missing package errors and followed instructions to add them as it happened, but am a bit stuck here:

Screenshot 2023-03-14 at 13 57 08

@Szymon-dziewonski
Copy link

@MattyBalaam this is exactly same error I have when updating from swc-plugin-coverage-instrument version 0.0.14 into 0.0.15

@MattyBalaam
Copy link
Author

This now has an issue in swc: swc-project/swc#7238

@MattyBalaam
Copy link
Author

@kwonoj thank you for trying to track down this issue.

I have updated to @swc/core 1.3.55 and swc-plugin-coverage-instrumet 0.0.17but I am still seeing the error on my M1 Mac. It happenes in Cypress and also Jest tests.

Would it be helpful for me to create a test repo?

@kwonoj
Copy link
Owner

kwonoj commented Apr 27, 2023

Looks like this issue have multiple things, the one fixed is swc-project/swc#7238. For the original one #200 (comment), I don't have an idea how plugin would affect those, since your screenshot points (): any => which is preserving typescript syntax, cause of ther error.

Plugin does not have way to control those. You'll probably need to investigate elsewhere.

@MattyBalaam
Copy link
Author

MattyBalaam commented Apr 28, 2023

My apologies, I have re-looked at the original issue I posted. The update some point over the last month when I have tried various swc updates the error changed to one about memory access and I had forgotten there was a different error message in my original post:

I see lots of messages like this now, I assume this is covered by other open issues?

thread '<unnamed>' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/Users/matthewbalaam/xxxxxx.cy.tsx")'

Caused by:
    0: failed to invoke `swc-plugin-coverage-instrument` as js transform plugin at ../../../node_modules/swc-plugin-coverage-instrument/target/wasm32-wasi/release/swc_plugin_coverage.wasm
    1: RuntimeError: out of bounds memory access
    2: heap_get_oob', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.260.35/src/plugin.rs:219:14

@MattyBalaam
Copy link
Author

Hmm, I’ve just tried a combination of @swc/core 1.3.39 or 1.3.40 and 0.0.15 to trace back the issue and the tests run fine for me with that combination, but not if I then bump to 0.0.17.

I get similar errors with 1.3.55 and 0.0.15 though. I’m not exactly sure which version starts breaking, but with 1.3.45 the terminal just gets to a point where it stalls before running tests.

Hope this is helpful in some way.

@MattyBalaam
Copy link
Author

With the latest v0.0.18 release the plugin now seems to work with a wide range of swc releases, including the latest.

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

Successfully merging a pull request may close this issue.

3 participants