Jimp: core-js version conflict

Created on 27 Aug 2018  路  15Comments  路  Source: oliver-moran/jimp

Expected Behavior

For jimp not to crasch when required.

Current Behavior

Crash on require.

Failure Information (for bugs)

Stack trace:

Error: Cannot find module 'core-js/modules/es6.object.define-property'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/srv/node_modules/jimp/dist/index.js:3:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)

Steps to Reproduce

  1. Add dependency to core-js 1.2.7
  2. Add dependency to latest jimp
  3. Require jimp

Context

  • Jimp Version: 0.3.2
  • Operating System: Ubuntu 18.04
  • Node version: 9.11.2

Most helpful comment

0.3.9 fixed the issue for me. Thx for fast response.

All 15 comments

This is an old bug. Please update to a newer version of jimp. This bug was fied on v0.3.5

Still an issue. Please check https://github.com/darkbob/jimp-issue-754

This is probably because babel polyfill relies on a specific version of core-js.

I got hit on this on multiple projects last evening.

is there anyway that you can upgrade to core-js v2.5.7? is there a reason you need to use the older version? @darkbob @lillem4n

It's one of my dependencies that uses an old version of core-js and for some reason it installs that version in the root of my dependency tree. Why cant jimp have core-js as a dependency when it obviously depends on it?

jimp depends on '@babel/polyfill' which in turn depends on 'core-js'. Since npm an yarn both install only one version of a dependency it would not matter if we depended on it directly. The same issue would happen.

Hm, I don't know about yarn but npm will install the specific depended upon version if it is required by the package. It would save us in our projects at least if jimp had a pinned dependency for core-js v2.5.7, I think.

Also, since Jimp directly requires the specific core-js file/lib a change in babel upstream would also break jimp in the future. The logical thing, I think, is to add core-js as a direct dependency to jimp.

@lillem4n can you try out v0.3.8 for me?

Just tried on one of the projects, does not seem to work sadly. :( I'll poke around a bit and see if I can make it work. I'll return my findings! Thanks for the super-fast replies and fixes and deploys!

It seems like i need to add an explicit dep to each package in the monorepo for this to work correctly

Okay I made the changes in v0.3.9 @lillem4n let me know if it works

0.3.9 fixed the issue for me. Thx for fast response.

Works here as well! Superior win! \o/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tutyamxx picture tutyamxx  路  4Comments

jBernavaPrah picture jBernavaPrah  路  4Comments

alyyousuf7 picture alyyousuf7  路  3Comments

Favna picture Favna  路  4Comments

master-of-null picture master-of-null  路  3Comments