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

Very infrequent TypeError: iconv.encodingExists is not a function #404

Open
FauxFaux opened this issue May 9, 2022 · 0 comments
Open

Very infrequent TypeError: iconv.encodingExists is not a function #404

FauxFaux opened this issue May 9, 2022 · 0 comments

Comments

@FauxFaux
Copy link
Contributor

FauxFaux commented May 9, 2022

This probably(:tm:) isn't a bug in needle, but it appears in needle, so I thought I'd raise it here, just in case someone else is going insane.

Very, very occasionally, we get this error in tests:

TypeError: iconv.encodingExists is not a function
    at StreamDecoder.Object.<anonymous>.StreamDecoder._transform (foo/node_modules/needle/lib/decoder.js:27:17)
    at StreamDecoder.Transform._read (internal/streams/transform.js:205:10)
    at StreamDecoder.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at StreamDecoder.Writable.write (internal/streams/writable.js:303:10)
    at IncomingMessage.ondata (internal/streams/readable.js:731:22)
    at IncomingMessage.emit (events.js:412:35)
    at IncomingMessage.emit (domain.js:475:12)
    at IncomingMessage.Readable.read (internal/streams/readable.js:504:10)
    at flow (internal/streams/readable.js:987:34)
    at resume_ (internal/streams/readable.js:968:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

I am reasonably sure this is impossible.

I have reviewed decoder.js and iconv-lite carefully. needle is loading a modern, compatible version of iconv-lite:

└─┬ needle@3.1.0
  └── iconv-lite@0.6.3 

We're using all kinds of mocking (jest 26, sinon 9, nock 13, etc.), but we have no reason to ever have touched iconv, or needle itself (beyond what nock does), and it's not isolated to any specific test. Node 14, linux.

I'll update here if we get anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant