"Error: The _read() method is not implemented" when used in the browser
See original GitHub issueI’m unable to run tape in the browser with a simple bundle via Parcel. I receive this error at the first test:
VM30:1 Uncaught Error: The _read() method is not implemented
at new o (<anonymous>:8:6099)
at x.i.register.x._read (<anonymous>:1:10516)
at x.i.register.x.read (<anonymous>:1:10218)
at U (<anonymous>:1:8934)
at x.<anonymous> (<anonymous>:1:11450)
at x.i.register.a.emit (<anonymous>:1:19390)
at x.s.resume (<anonymous>:1:3378)
at x.To.r.resume (<anonymous>:8:84632)
at x.i.register.x.on (<anonymous>:1:12975)
at x.i.register.x.pipe (<anonymous>:1:11939)
Repro
- Create a test.js file:
import test from 'tape';
test('test using promises', t => {
t.pass();
});
- Run these commands
echo '{}' > package.json
npm i tape parcel
npx parcel build test.js
- Copy the content of
dist/main.jsand execute it in the browser, like in the console.
Screenshot
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
node.js - _read() is not implemented on Readable stream
createReadStream() will create read stream with the _read() function has been auto implemented to push file data and end when end of file....
Read more >Error 501 Not Implemented: how to fix it and main causes
When the Error 501 code is returned, it means that the method used to fulfill the request does not work or was not...
Read more >How to Fix the HTTP 501 Not Implemented Error on Your Site
The HTTP 501 Not Implemented status code indicates that the server does not support the functionality required to fulfill the request.
Read more >How to Fix Request Method 'POST' Not Supported - Hyperping
The Request Method' POST' Not Supported error is caused by a mismatch of the web browser configuration and the browser's URL format.
Read more >X" on Jest + JSDOM for component unit tests - Raul Melo
In this post I explain how to fix "Not implemented" problems while using Jest + JSDOM for component unit test.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, adding that line to
node_modules/tape/package.jsonhelps!resolve.fallback.fs = falsecan be left out.I opened a specific issue regarding
pathandstream, since this issue was actually due to Parcel and unrelated to Tape (even though it could be avoided altogether with https://github.com/substack/tape/issues/564)Sure, and if there’s an easy way to fix it that doesn’t impose a cost on those using working bundlers, I’m all for it.
Can you give https://github.com/substack/tape/issues/561#issuecomment-909469015 a shot and confirm that will help?