Skip to content

The "id" argument must be of type string, ReadableStream is not defined #1

Closed

Description

@mbykov

Something wrong:

yarn test
....
==> ReferenceError: ReadableStream is not defined
cd examples
node ./promises.js
....
==> Error: Setting up fake worker failed: "The "id" argument must be of type string. Received type object".

the same error with events.js

Activity

  1. scriptcoded commented on Jul 7, 2020

    @scriptcoded
    Owner

    Thanks for reporting!

    I read through the readme, and realized that it's not clear how to run the examples and the tests. To run the tests you first need to build the library to generate the lib directory. This can be done with the command npm run build. The same goes for the examples. An easier way to run the examples might be npm run example:promises. If you look in package.json you'll see the available scripts.

    As for why you're getting a ReferenceError when running the test suite is unclear to me. Could you perhaps provide a few details about your environment, such as operating system and Node.js version?

    Worth noting is that I can't guarantee that this module can be run from source with Yarn, as I've developed it with NPM and only provide a package-lock.json.

    I'll make sure to make the readme a bit more clear when I get the time.

  2. elliotsoomro commented on Aug 13, 2020

    @elliotsoomro

    I get the same error just from running the "minimal example". Help plz

  3. ddennis commented on Aug 28, 2020

    @ddennis

    Same here

      Error: Setting up fake worker failed: "The "id" argument must be of type string. Received an instance of Object".
        at ...\node_modules\pdfjs-dist\build\pdf.js:2336:38
    
    Process finished with exit code 0
    

    running on windows
    node v12.16.1

  4. scriptcoded commented on Aug 30, 2020

    @scriptcoded
    Owner

    A few people seem to be having this problem. I haven't had a lot of time to look in to it, but as a temporary workaround you can clone the project outside node_modules. The issue only seems to happen when the library is installed through NPM.

    1. Clone the library into your project: git clone [email protected]:scriptcoded/simple-pdf.git
    2. Enter the clone directory cd simple-pdf
    3. Install dependencies npm install
    4. Build the library npm build
    5. Import the library using const { SimplePDFParser } = require('./simple-pdf/lib')
  5. scriptcoded commented on Aug 30, 2020

    @scriptcoded
    Owner

    There was an issue with PDF.js's alternate worker. This should be fixed with version v0.1.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions