question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browser version requires missing files.

See original GitHub issue

Expected Behavior

Using the browser version of JIMP, e.g. when running Browserify on a Node.JS package that requires JIMP, should be clean, as it should contain all of the JIMP code in a single file.

Current Behavior

Browserify (most likely the browser too, if you use the browser version directly in the browser) will error due to erroneous calls to require().

Failure Information (for bugs)

The error complains about ./src/converter, which simply doesn’t exist in jimp/browser (where jimp is the node_modules subfolder where jimp is installed, when installed from npm).

Steps to Reproduce

I haven’t tried to use JIMP directly in the browser, but here’s how to reproduce this error the way I noticed it.

  1. Create a simple Node.JS project.
  2. Install JIMP as a dependency (npm i --save jimp).
  3. Create an index.js file with the following contents:
const JIMP = require('jimp');
  1. Run browserify index.js.

Context

  • Jimp Version: JIMP 0.6.0.
  • Operating System: Linux Mint 19 “Tara” (Ubuntu fork), kernel Linux v4.20.
  • Node version: Node.JS v8.10.0.

Failure Logs

> nodemips@0.1.1 build /home/gustavo6046/Source code/nodemips
> browserify -r ./index.js:mips | babel --minified -f minif.tmp | uglifyjs >browser/mips.js

Error: Cannot find module './src/converter' from '/home/gustavo6046/Source code/nodemips/node_modules/jimp/browser/lib'
    at /home/gustavo6046/Source code/nodemips/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
    at load (/home/gustavo6046/Source code/nodemips/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/home/gustavo6046/Source code/nodemips/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /home/gustavo6046/Source code/nodemips/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:152:21)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
wallabracommented, Jul 11, 2020

I can do it if you want me to. It’ll be quick and simple enough.

Either way, maybe it would be a good idea to assign someone to do the job, to avoid concurrent pull requests trying to do the same thing.

1reaction
wallabracommented, Jan 19, 2019

I’m pretty sure it would be better to leave it to the user, unless JIMP relies on features that don’t work in the browser.

Read more comments on GitHub >

github_iconTop Results From Across the Web

All files missing, including media files, document files and ...
2. Go to C:\Windows.Old folder and look for your files here. These folders will be hidden, so you need to make it visible...
Read more >
missing files error - Adobe Support Community - 9234086
Solved: With newest Muse update I keep getting this error when published "Some files on the server may be missing or incorrect. Clear...
Read more >
Fix file download errors - Google Chrome Help
This error means that there's not enough space on your computer to download the file. To fix the error: Delete some files from...
Read more >
How to Solve The HTML5 Video 'File Not Found' Error?
Hi Francesca, This error 224003 is a online video playback error. May be your browser doesn't support the IMDB video file type. Ensure...
Read more >
Why is my song telling me that there are missing files?
You may have inadvertently deleted the files during system cleanup or something similar. (if searching, search the system trash as well); The files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found