# Using actions/checkout@v4 randomly fails with syntax error

**URL:** <https://forum.gitea.com/t/using-actions-checkout-v4-randomly-fails-with-syntax-error/10464>\
**Category:** Actions\
**Created:** [January 22, 2025, 7:22pm UTC](https://forum.gitea.com/t/using-actions-checkout-v4-randomly-fails-with-syntax-error/10464 "2025-01-22T19:22:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CoderDennis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/coderdennis/32/6579_2.png) [@CoderDennis](https://forum.gitea.com/u/CoderDennis)\
**Post date:** [January 22, 2025, 7:22pm UTC](https://forum.gitea.com/t/using-actions-checkout-v4-randomly-fails-with-syntax-error/10464/1 "2025-01-22T19:22:28Z")

</div>

We’re running self hosted version 1.22.6. `actions/checkout@v4` works most of the time, but occasionally fails with the following syntax error. When that happens, I just click the “Re-run all jobs” button until it succeeds. Is there something we can do to make the action less fragile?

```auto
/opt/act_runner/work/434c1e5425e154c8/act/actions/c3fe249fe73091a17d6638fe1341e7bd0bcc3466ce52323c0688e83e2463a4ab/dist/index.js:7647
  static {
         ^
SyntaxError: Unexpected token '{'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

```

---

<div class="post-metadata">

**Author:** ![LennyTsaiEveryTime](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lennytsaieverytime/32/6670_2.png) [@LennyTsaiEveryTime](https://forum.gitea.com/u/LennyTsaiEveryTime)\
**Post date:** [February 13, 2025, 9:23am UTC](https://forum.gitea.com/t/using-actions-checkout-v4-randomly-fails-with-syntax-error/10464/2 "2025-02-13T09:23:06Z")

</div>

I have it to, did you know hot to fix it?  
thanks.

I roll back to v3 and it’s ok,

---

<div class="post-metadata">

**Author:** ![CoderDennis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/coderdennis/32/6579_2.png) [@CoderDennis](https://forum.gitea.com/u/CoderDennis)\
**Post date:** [February 13, 2025, 10:10pm UTC](https://forum.gitea.com/t/using-actions-checkout-v4-randomly-fails-with-syntax-error/10464/3 "2025-02-13T22:10:31Z")

</div>

We rolled back to v3, but then moved to v4 again after upgrading node on the build server.

I’m not sure if it was the problem with this action, but we did determine that we were getting intermittent failure caused by having multiple act runners without the proper labels to ensure we always got the one that had the required dependencies.

v4 has been working reliably for over a week now.
