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

UnhandledPromiseRejectionWarning: entry.isFile is not a function #144

Closed
robbiedigital opened this issue Jan 7, 2019 · 13 comments
Closed
Assignees

Comments

@robbiedigital
Copy link

Environment

  • OS Version: MacOS Mojave 10.14.2
  • Node.js Version: 10.14.1

Error

(node:61869) UnhandledPromiseRejectionWarning: TypeError: entry.isFile is not a function
    at EntryFilter.onlyFileFilter (/Users/username/projects/projectname/node_modules/fast-glob/out/providers/filters/entry.js:56:49)
    at EntryFilter.filter (/Users/username/projects/projectname/node_modules/fast-glob/out/providers/filters/entry.js:32:18)
    at /Users/username/projects/projectname/node_modules/fast-glob/out/providers/filters/entry.js:18:48
    at /Users/username/projects/projectname/node_modules/fast-glob/out/adapters/fs-stream.js:33:39
(node:61869) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:61869) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@iameli
Copy link

iameli commented Jan 7, 2019

My repro from #145:

touch empty-file.js
npx parcel empty-file.js

Edit: hardcoding "fast-glob": "2.2.4" in package.json should work around the issue for most use cases.

@RossComputerGuy
Copy link

This also happens to me, I updated OS.js to the latest version and now BlueLight 0.1.9-prealpha has to be delayed.

@krhae
Copy link

krhae commented Jan 7, 2019

Similarly:

> Error! TypeError: entry.isFile is not a function
      at EntryFilter.onlyFileFilter (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/filters/entry.js:56:49)
      at EntryFilter.filter (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/filters/entry.js:32:18)
      at /var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/filters/entry.js:18:48
      at /var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/adapters/fs-sync.js:32:36
      at Array.forEach (<anonymous>)
      at FileSystemSync.read (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/adapters/fs-sync.js:29:18)
      at ReaderSync.staticApi (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/reader-sync.js:70:31)
      at ReaderSync.api (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/reader-sync.js:58:21)
      at ReaderSync.read (/var/buildagent/work/ec53ef539b8579c2/node_modules/fast-glob/out/providers/reader-sync.js:41:32)
      at Array.map (<anonymous>)

@mrmlnc
Copy link
Owner

mrmlnc commented Jan 7, 2019

Related to the latest release. Fix it ASAP.

@mfasman95
Copy link

Seeing the same issue on:
Node - 10.13.0
NPM - 6.4.1

@RossComputerGuy
Copy link

This is an example of how 1 little bug can cause an uproar.

@mrmlnc
Copy link
Owner

mrmlnc commented Jan 7, 2019

Sorry, this applies to the latest release 😭

I revert latest tag for this package to the 2.2.4 version and work on fix for 2.2.5 right now.

npm i fast-glob currently work correctly.

@GuyMograbi
Copy link

@mrmlnc how soon do you think we will be able to see this fixed.
Not all of us can downgrade to 2.2.4 with our setup.

Is it possible to remove version 2.2.5 from npm?
Is it possible to quickly revert change and bump to 2.2.6?

@crantron
Copy link

crantron commented Jan 7, 2019

My deployments started failing and I was pulling my hair out. Thank you so much for being on top of this. Cheers.

@mrmlnc
Copy link
Owner

mrmlnc commented Jan 7, 2019

I publish a new version (2.2.6) where I revert the broken changes.

@mrmlnc
Copy link
Owner

mrmlnc commented Jan 7, 2019

Prelude

Thank you for using my package. I really appreciate it 🎉 ❤️

I'm sorry about what happened today. This is the first release when I did not conduct integration tests, because the changes seemed insignificant to me (main changes related to the Stream API with a small number of users).

Unfortunately, I forgot about the commit where I changed the code style.

What happened?

In the commit I replaced Object.assign to Object Spread operator. Crazy… and… with unknown assertion (as unknown as Entry). Hell yeah!

Base code

class Some {
	isFile() {
		return 'here';
	}
}

const some = new Some();

some.isFile();
// -> 'here'

Before

Object.assign(some, {
	additionalProperty: 'value'
});

some.isFile();
// -> 'here'

After

const newSome = { ...some };

newSome.isFile();
// TypeError: newSome.isFile is not a function

What's next?

  • Never publish a version without testing the core functionality.
  • Automate integration tests. Start for each push to the master branch.
  • Add smoke tests for output of fast-glob.
  • Never use unknown assertion without absolute necessity.

@GuyMograbi
Copy link

@mrmlnc thank you for this quick response.
It happens to everyone.

@vitkarpov
Copy link

Fast-glob is officially the new left-pad now 😉

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

No branches or pull requests

9 participants