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.

Use Jimp in Browser with webpack build

See original GitHub issue

I’m facing a lot of issues when trying to use Jimp on browser with webpack build. I tried to used browser version by import Jimp from 'jimp/browser/lib/jimp'; But it didn’t work and i got error _jimp2.default.read is not a function Could you please help me to solve that? Because i used Jimp on node server and it worked perfectly. So I really want to use Jimp in Browser.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
steffkelseycommented, Feb 14, 2018

If you’re pulling from npm, the 0.2.28 version is completely broken for browser. I ended up grabbing version 0.2.27 and then my import statement looked like this: import 'jimp/browser/lib/jimp'; and everything worked fine from there (can just call Jimp.read(...))

1reaction
hipstersmoothiecommented, Jul 27, 2018

@niccih https://github.com/hipstersmoothie/jimp-example let me know if you have any problems!

Read more comments on GitHub >

github_iconTop Results From Across the Web

jimp - npm
An image processing library for Node written entirely in JavaScript, with zero native dependencies. The default jimp configuration. Supported ...
Read more >
"webpack 5 breaking change" after installing Jimp
I am building a react app with react-dom v18 and react v18. I installed jimp, and got the following error. And I am...
Read more >
How to Bundle a Simple Static Site Using Webpack - SitePoint
In this article, I'm going to show you how to install and configure webpack, then use it to create minified bundles for a...
Read more >
Recipes on how to create a library that supports both browser ...
About. Introduces how to build a library that supports both browser and Node.js using webpack4 and ES6, and how to use the created...
Read more >
Tree Shaking - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
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