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

Most recent release (v5.27.1) introduced Syntax Error #2399

Closed
JodliDev opened this issue Nov 3, 2023 · 4 comments
Closed

Most recent release (v5.27.1) introduced Syntax Error #2399

JodliDev opened this issue Nov 3, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@JodliDev
Copy link

JodliDev commented Nov 3, 2023

Bug Description

Hello, unfortunately I can not be too specific because I am not directly using this library. But I am quite certain my issue is caused by undici. I will try to give you as much information as I can :)

I have a github action, which uses https://github.com/ButlerLogic/action-autotag - which seems to use this library.
About 4 hours ago, it worked fine (and has been for years). Without changing anything on my end, it started failing about an hour ago (which is timed perfectly with the most recent update of this library).

The error I am getting is:

/app/node_modules/undici/lib/core/request.js:122
      if (!this.body._readableState?.autoDestroy) {
                                    ^

 SyntaxError: Unexpected token '.'
    at Object.compileFunction (vm.js:344:18)
    at wrapSafe (internal/modules/cjs/loader.js:1048:15)
    at Module._compile (internal/modules/cjs/loader.js:1082:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Function.Module._load (internal/modules/cjs/loader.js:875:14)
    at Module.require (internal/modules/cjs/loader.js:1022:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/app/node_modules/undici/lib/client.js:13:17)
    at Module._compile (internal/modules/cjs/loader.js:1118:30)

After a little bit of research it seems this error is caused by this line:

if (!this.body._readableState?.autoDestroy) {

Which was added by the most recent commit (https://github.com/nodejs/undici/pull/2391/files) which has been merged yesterday (and was published with the last version an hour ago. So the timeline of this change perfectly adds up with when this issue started happening on my end.

The full report of my error is here (though I think others can not access the full report):
https://github.com/KL-Psychological-Methodology/ESMira-web/actions/runs/6748712011/job/18347880464

Reproducible By

I am sorry. Since I am not sure how https://github.com/ButlerLogic/action-autotag is using this library, I cant really add anything here.

Expected Behavior

No syntax error :)

Logs & Screenshots

This the full output of my faulty github action

Run butlerlogic/action-autotag@stable
  with:
    strategy: package
    tag_prefix: pre.
    root: ./
  env:
    GITHUB_TOKEN: ***
/usr/bin/docker run --name a3030cf520d43bdce47a9af24787f8c3e3a53_7a236c --label 8a3030 --workdir /github/workspace --rm -e "GITHUB_TOKEN" -e "INPUT_STRATEGY" -e "INPUT_TAG_PREFIX" -e "INPUT_ROOT" -e "INPUT_PACKAGE_ROOT" -e "INPUT_TAG_SUFFIX" -e "INPUT_TAG_MESSAGE" -e "INPUT_COMMIT_MESSAGE_TEMPLATE" -e "INPUT_VERSION" -e "INPUT_REGEX_PATTERN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ESMira-web/ESMira-web":"/github/workspace" 8a3030:cf520d43bdce47a9af24787f8c3e3a53
/app/node_modules/undici/lib/core/request.js:122
      if (!this.body._readableState?.autoDestroy) {
                                    ^

SyntaxError: Unexpected token '.'
    at Object.compileFunction (vm.js:344:18)
    at wrapSafe (internal/modules/cjs/loader.js:1048:15)
    at Module._compile (internal/modules/cjs/loader.js:1082:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Function.Module._load (internal/modules/cjs/loader.js:875:14)
    at Module.require (internal/modules/cjs/loader.js:1022:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/app/node_modules/undici/lib/client.js:13:17)
    at Module._compile (internal/modules/cjs/loader.js:1118:30)

Environment

Ubuntu 22.04.3 LTS

Additional context

Used by https://github.com/ButlerLogic/action-autotag

@JodliDev JodliDev added the bug Something isn't working label Nov 3, 2023
@ronag
Copy link
Member

ronag commented Nov 3, 2023

Thanks for reporting. Will have it fixed asap.

@JodliDev
Copy link
Author

JodliDev commented Nov 3, 2023

Ah dang, sorry. You were to efficient! I was about to close this issue, because I dont think it is an issue on your end after all.

I was digging a bit deeper. And noticed these warnings at the building phase of my github action:

   #9 2.892 npm WARN notsup Unsupported engine for undici@5.27.1: wanted: {"node":">=14.0"} (current: {"node":"13.14.0","npm":"6.14.4"})
  #9 2.892 npm WARN notsup Not compatible with your version of node/npm: undici@5.27.1

It seems like the stable branch of https://github.com/ButlerLogic/action-autotag uses a docker file that is fixed on NodeJS 13 (but is still using the most recent version of this library...)
And as far as I can see, optional chaining was not supported until NodeJS 14. The only reason this has not been an issue until your last update, seems to be that this project has not been using optional chaining until now.
But never the less if you want to remove the optional chaining in case they are not fixing the issue on their end, I would also be very thankful.
But I will also open an issue there because the problem seems to be caused by https://github.com/ButlerLogic/action-autotag using an outdated version of nodeJS and not your code :)

Thank you for your very fast response time! :)

@ronag
Copy link
Member

ronag commented Nov 3, 2023

Well it's fixed in 5.27.2 anyway :).

@JodliDev
Copy link
Author

JodliDev commented Nov 3, 2023

Thanks a lot! That makes my life a lot easier! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants