You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The "id" argument must be of type string, ReadableStream is not defined #1
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".
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.
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
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.
Clone the library into your project: git clone [email protected]:scriptcoded/simple-pdf.git
Enter the clone directory cd simple-pdf
Install dependencies npm install
Build the library npm build
Import the library using const { SimplePDFParser } = require('./simple-pdf/lib')
Activity
scriptcoded commentedon Jul 7, 2020
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 benpm run example:promises. If you look inpackage.jsonyou'll see the available scripts.As for why you're getting a
ReferenceErrorwhen 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.
elliotsoomro commentedon Aug 13, 2020
I get the same error just from running the "minimal example". Help plz
ddennis commentedon Aug 28, 2020
Same here
running on windows
node v12.16.1
scriptcoded commentedon Aug 30, 2020
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.git clone [email protected]:scriptcoded/simple-pdf.gitcd simple-pdfnpm installnpm buildconst { SimplePDFParser } = require('./simple-pdf/lib')scriptcoded commentedon Aug 30, 2020
There was an issue with PDF.js's alternate worker. This should be fixed with version
v0.1.11.