← All tasks
javascriptsindresorhus/file-type #508Not a task: already works

"Concurrent read operation" error thrown reading from stream

envgap__sindresorhus__file-type-508

01 / FAILURE SIGNATURE

As reported upstream

Error {
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
ec2c02d587ffa7a09956e0ec2d2412df6da5cb76
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

sindresorhus/file-type #508 · read the original issue
### Context

Node.js version v12.22.7, but it does not occur using Node.js 14, & 16

Since file-type version [v17.0.0](https://github.com/sindresorhus/file-type/releases/tag/v17.0.0)



### Reproduce:



Using Node.js v12, run



```shell

npx ava --fail-fast --serial

```

which will fail:

 ```

  √ validate the input argument type

  √ validate the repo has all extensions and mimes in sync

  √ odd file sizes

  ─



  fixture-big-endian.tif 79 .fromStream() method - same fileType



  Rejected promise returned by test. Reason:



  Error {

    message: 'Concurrent read operation?',

  }



  » StreamReader._read (file:///node_modules/peek-readable/lib/index.js:96:19)

  » StreamReader.read (file:///node_modules/peek-readable/lib/index.js:79:41)

  » ReadStreamTokenizer.readBuffer (file:///node_modules/strtok3/lib/ReadStreamTokenizer.js:35:51)

  » ReadStreamTokenizer.readToken (file:///node_modules/strtok3/lib/AbstractTokenizer.js:22:32)

  » FileTypeParser.readTiffTag (file:///core.js:1421:38)

  » FileTypeParser.readTiffIFD (file:///core.js:1441:32)

```

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]