fregante/image-promise

6.1.0 build is invalid

iam4x opened this issue · 5 comments

iam4x commented

Hi, first of all thank you for this library!

With the new TypeScript update, the build is not working for older NodeJS versions that does not supports the import syntax:

> Build error occurred
--
07:02:59 PM | /zeit/3a0e664/node_modules/image-promise/index.js:64
07:02:59 PM | export default loadImages;
07:02:59 PM | ^^^^^^
07:02:59 PM | SyntaxError: Unexpected token export
07:02:59 PM | at createScript (vm.js:80:10)
07:02:59 PM | at Object.runInThisContext (vm.js:139:10)
07:02:59 PM | at Module._compile (module.js:616:28)
07:02:59 PM | at Object.Module._extensions..js (module.js:663:10)
07:02:59 PM | at Module.load (module.js:565:32)
07:02:59 PM | at tryModuleLoad (module.js:505:12)
07:02:59 PM | at Function.Module._load (module.js:497:3)
07:02:59 PM | at Module.require (module.js:596:17)
07:02:59 PM | at require (internal/module.js:11:18)
07:02:59 PM | at Object.KwyZ (/zeit/3a0e664/.next/serverless/pages/blog.js:1585:18)
07:02:59 PM | error Command failed with exit code 1.

I would recommend you to use https://github.com/developit/microbundle in order the build and distribute this library easily for everyone.

WDYT?

Refer to fregante/meta#1

It’s a ES Module package since v6.

In your case (I’m guessing you use Next.js) I think this can help vercel/next.js#706 (comment)

I screwed up semver.

6.0.0 was CommonJS and 6.1.0 is an ES Module.

I'll release a custom 6.1.1 as both CJS and ESM (like 6.0.0) and then a new 7.0.0 with ESM only.

iam4x commented

Thank you 👍

Done, sorry for the noise