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

engine.io 6.6.3 syntax error issue with downstream cookie package in latest update - Gulp/Npm/Node JS compiler. #5283

Closed
freonirons409 opened this issue Jan 23, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@freonirons409
Copy link

freonirons409 commented Jan 23, 2025

Describe the bug
When running Gulp with browsersync, the latest build of engine.io throws the following errors that appear in the downstream cookie dependency:

/<PATH>/node_modules/engine.io/node_modules/cookie/dist/index.js:83
    const dec = options?.decode || decode;
                        ^
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 Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/<PATH>/node_modules/engine.io/build/server.js:11:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

To Reproduce
Run a node JS instance using gulp with latest version of engine.io. Reverting back to 6.6.2 resolves the issue completely.

Socket.IO server version: 4.8.1
Engine.IO dependency version: 6.6.3

Expected behavior
Successful build completion using gulp, NPM, Node JS
Gulp: 4.0
Node: 20.22
NPM: 10

Platform:

  • Device: All devices
  • OS: MacOS 15.2, ChromeOS 131.0.6778.241,
@freonirons409 freonirons409 added the to triage Waiting to be triaged by a member of the team label Jan 23, 2025
@ipmincubus1369
Copy link

ipmincubus1369 commented Jan 24, 2025

One more issue with 6.6.3 - it is pulling in cookie@~1.0.2, which requires node version >= 18, this is breaking for all environment under 18.

@sara1528
Copy link

I'm getting these same errors, I currently cannot upgrade node, and now I cannot run my karma tests, as they depend on socket.io which is broken because of this issue,
hope it will be fixed soon

@rhgoddard
Copy link

Also seeing this issue, and the only way we can get beyond it to use BrowserSync is to run:
npm install [email protected] --save-dev

darrachequesne added a commit that referenced this issue Jan 28, 2025
This reverts commit 7427109.

The new version of the `cookie` package contains code with optional chaining (`?.`), which is not supported by older Node.js versions (< 14).

The types for cookie are now bundled, so that there is no conflict with the types coming from `cookie@1`:

> error TS2724: '"cookie"' has no exported member named 'CookieSerializeOptions'. Did you mean 'SerializeOptions'?
>
> import type { CookieSerializeOptions } from "cookie";
>               ~~~~~~~~~~~~~~~~~~~~~~

Related: #5283
@darrachequesne
Copy link
Member

cookie has been reverted to version ~0.7.2 in 5a31aaf, released in [email protected].

Could you please check?

@darrachequesne darrachequesne added bug Something isn't working and removed to triage Waiting to be triaged by a member of the team labels Jan 28, 2025
@ipmincubus1369
Copy link

Yes, issue fixed now. Thank!

@philippe-granet
Copy link

I confirm, issue fixed now!

@darrachequesne
Copy link
Member

Great, thanks for the heads-up 👍

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

6 participants