Adding images doesn't work in the browser
See original GitHub issueUsing Browserify width PDFKit works great, but there’s an issue with brfs when trying to add an image (see https://github.com/substack/brfs/issues/36).
Trying to add an image gives you this in the console:
TypeError: fs.readFileSync is not a function
Basically, the transform for fs.readFileSync()
only works when a string is the first parameter. Line 30 of image.js seems to be the problem:
data = fs.readFileSync(src);
Try adding any image to the demo and you get the same thing. The issue referenced above in the brfs repo has been open since October and doesn’t sound trivial. Any suggestions for a way round this problem?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
7 Reasons Why Images Are Not Loading on Your Website
Website images fail to load for one of these seven common reasons.
Read more >7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
Open Chrome's menu and head to Settings. · From the left pane, click Privacy and security. · Click Site Settings > Images. ·...
Read more >[Answer] Why and How to Fix Images Not Showing on Website?
Fix 1: Open the Image in a Different Browser ... Most of the time, due to some bugs in the browser you are...
Read more >Resolve the "Images Not Showing on Website" Error [2022]
To resolve the images not showing problem, just close Chrome and open the Run prompt. Now, enter the '%localappdata%' command to go to...
Read more >How to Fix Images Not Loading in Chrome - Online Tech Tips
How to Fix Images Not Loading in Chrome · Use a Different Browser to Access Your Webpage · Allow Sites to Display Images...
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 FreeTop 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
Top GitHub Comments
There is a simple workaround when using browserify.
It worked fine for me.
Here’s an example: https://jsfiddle.net/rkolasie/6xxmLa38/