Live data from Hacker News

A one-line package broke `npm create-react-app`

github.com

31–40 of 478 posts

Re: A one-line package broke `npm create-react-app`

#33
Digging into the reason behind breakage, the change is this one: https://github.com/then/is-promise/commit/feb90a40501c8ef69b...

Which adds support for ES modules: https://medium.com/@nodejs/announcing-core-node-js-support-f...

However the exports syntax requires a relative url, e.g. ‘./index.mjs’ not ‘index.mjs’. The fix is here: https://github.com/then/is-promise/pull/15/commits/3b3ea4150...

Re: A one-line package broke `npm create-react-app`

#35
post #7

And the source code of the library is: function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }

And the ways you can fund it are here: https://github.com/then/is-promise/blob/master/.github/FUNDI...

Re: A one-line package broke `npm create-react-app`

#36
post #7

And the source code of the library is: function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }

My prior decision to never work with JavaScript again has just grown firmer.

I second this, JavaScript Devs are near the bottom of the food chain, just above VB Devs.

Myself as a Java developer is middle of the pyramid. The apex predators are embedded developers, followed by c Devs then game Devs.

Re: A one-line package broke `npm create-react-app`

#37
post #6

Earlier quoted context omitted.

I don't know how "clickbait" that title can be when it is, in fact, longer than the line of code in question: declare function isPromise (obj: Promise | S): obj is Promise ; This is, indeed, the only line of exported code in the entire package. I genuinely don't understand the NPM world.

> I genuinely don't understand the NPM world. You're right, you don't. What you posted is just the function declaration, not the implementation.

[deleted]

Re: A one-line package broke `npm create-react-app`

#38
It's downloaded 11 million times a week. This touches a good majority of the Node ecosystem, so there's going to be quite a lot that doesn't work until this is remedied. And I'm not sure that package-lock.json is going to save folks here because it was a minor version update.

https://www.npmjs.com/package/is-promise

Re: A one-line package broke `npm create-react-app`

#39

Earlier quoted context omitted.

Could create-react-app have avoided this through regression suites?

Bumping your comment because I would like to know. I'm following the github thread.

Potentially. If cra had pinned all their deps, and used a bot to automatically bump deps contingent on passing a comprehensive regression matrix, this would have been avoided. GitHub's Dependabot is good for this. In my opinion everybody besides libraries should pin deps and use dependabot.
Post reply on HN