Skip to content

fast-text-encoding usage breaks compatibility with Emscripten based libaries #380

@curvedriver

Description

@curvedriver

Environment details:

OS: Linux
node: 10.23.1
npm: 6.14.10

  • @google-cloud/translate: 6.1.0
    which requires version ^2.9.2 of google-gax

Description:

google-gax 2.10.0 introduced fast-text-encoding, which breaks the compatibility with Emscripten based libaries.

https://github.com/googleapis/gax-nodejs/blob/eed447fdbac1340109b2bfc0d50460cc1c790f6b/src/fallback.ts#L22

Error

RangeError: Failed to construct 'TextDecoder': The encoding label provided ('utf-16le') is invalid.

Caused by

https://github.com/emscripten-core/emscripten/blob/d7c7aedf45aafb72a8ca617fdfca98311f76525a/src/runtime_strings_extra.js#L38

Similar to:
googleapis/google-auth-library-nodejs#626

Metadata

Metadata

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions