Skip to content

ReferenceError: TextDecoder is not defined #683

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

Closed
fenzaiway opened this issue Jun 25, 2023 · 5 comments
Closed

ReferenceError: TextDecoder is not defined #683

fenzaiway opened this issue Jun 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@fenzaiway
Copy link

/Users/aa/Documents/work/dd/pass/static/node_modules/engine.io/build/server.js:16
const TEXT_DECODER = new TextDecoder();
^

ReferenceError: TextDecoder is not defined
at Object. (/Users/aa/Documents/work/dd/pass/static/node_modules/engine.io/build/server.js:16:22)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)

@fenzaiway fenzaiway added the bug Something isn't working label Jun 25, 2023
@bmeijwaard
Copy link

bmeijwaard commented Jun 26, 2023

+1 my legacy project pipeline started breaking since a week. Nodejs v10.24.1 with Gulp 4.0.0
Using v6.4.2 didn't work either.

ReferenceError: TextDecoder is not defined
at Object. (..\node_modules\engine.io\build\server.js:16:22)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (..\node_modules\engine.io\build\engine.io.js:5:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)

@fenzaiway
Copy link
Author

fenzaiway commented Jun 26, 2023 via email

@iowaguy
Copy link
Contributor

iowaguy commented Jun 26, 2023

I am also seeing this issue. Same situation: my pipeline that was previously working is now failing here. Adding const { TextDecoder } = require("util"); before the offending line in server.js seems to let the build continue.

This line was added in 6.5.0, but it seems that the proper libraries were not imported: https://github.com/socketio/engine.io/blame/9608781efe32aa4a5f2800923aabc2a3be8c7148/lib/server.ts#L23

@bmeijwaard
Copy link

Disabled NPM package browser-sync for the time being. This depends on socket.io, which depends on engine.io.

@darrachequesne
Copy link
Member

This should be fixed by 6dd2bc4, included in version 6.5.1.

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

4 participants