Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup+TypeScript+Jimp: Error: 'default' is not exported by node_modules/jimp/es/index.js, imported by src/index.ts #967

Closed
mogoh opened this issue Dec 9, 2020 · 2 comments

Comments

@mogoh
Copy link

mogoh commented Dec 9, 2020

I am not sure if this issue is in Rollup, a rollup plugin, or Jimp.
So, if this is (for sure) not a Jimp issue, please close this issue and point me to the right direction.
I have also opened an issue over at rollup and will provide a link.

Expected Behavior

Compile and Bundle src/index.ts

Current Behavior

$ yarn rollup
yarn run v1.22.5
$ rollup --config

./src/index.ts → ./dist...
[!] Error: 'default' is not exported by node_modules/jimp/es/index.js, imported by src/index.ts
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/index.ts (1:7)
1: import Jimp from 'jimp/es';
          ^
2: 
3: // open a file called "lenna.png"
Error: 'default' is not exported by node_modules/jimp/es/index.js, imported by src/index.ts
    at error (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:5265:30)
    at Module.error (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:9835:16)
    at handleMissingExport (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:9724:28)
    at Module.traceVariable (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:10228:24)
    at ModuleScope.findVariable (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:8747:39)
    at MemberExpression.bind (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:6451:49)
    at CallExpression$1.bind (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:2868:23)
    at CallExpression$1.bind (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:6644:15)
    at MemberExpression.bind (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:2868:23)
    at MemberExpression.bind (/home/mogoh/src/github.com/mogoh/rollup-typescript-jimp/node_modules/rollup/dist/shared/rollup.js:6469:19)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Failure Information (for bugs)

Steps to Reproduce

  • Jimp Version: 0.16.1
  • Operating System (or Browser): Ubunut 20.10
  • Node Version (if applicable): 15.3.0

Failure Logs

see above

@mogoh
Copy link
Author

mogoh commented Dec 9, 2020

Here is the issue at rollup: rollup/rollup#3900

@hipstersmoothie
Copy link
Collaborator

Fix module build. If you have more problems feel free to open new issues #1149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants