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

fs.statAsync should not be defined globally #3466

Closed
matz3 opened this issue Apr 9, 2020 · 1 comment · Fixed by #3467
Closed

fs.statAsync should not be defined globally #3466

matz3 opened this issue Apr 9, 2020 · 1 comment · Fixed by #3467
Labels

Comments

@matz3
Copy link
Contributor

matz3 commented Apr 9, 2020

There seems to be a problem with karma v5.0.0 that is caused by the fact karma defines fs.statAsync (actually graceful-fs).
Other projects that still use bluebird seem to crash now. In this case our karma-ui5 plugin internally uses cacache (via pacote), which loads bluebird.
I did not fully debug the actual issue, but in general I would not expect karma to extend/modify API of another module, as this likely affects other code running within the same process.

I've created a PR to fix this issue: #3467

git clone [email protected]:SAP/openui5-sample-app.git
cd openui5-sample-app
npm install
npm install -D karma@5
npm test
09 04 2020 21:28:25.584:ERROR [ui5.framework]: Cannot promisify an API that has normal methods with 'Async'-suffix

    See http://goo.gl/MqrFmX

09 04 2020 21:28:25.584:DEBUG [ui5.framework]: TypeError: Cannot promisify an API that has normal methods with 'Async'-suffix

    See http://goo.gl/MqrFmX

    at checkValid (/github/SAP/openui5-sample-app/node_modules/bluebird/js/release/promisify.js:54:27)
    at promisifiableMethods (/github/SAP/openui5-sample-app/node_modules/bluebird/js/release/promisify.js:77:5)
    at promisifyAll (/github/SAP/openui5-sample-app/node_modules/bluebird/js/release/promisify.js:241:9)
    at Function.Promise.promisifyAll (/github/SAP/openui5-sample-app/node_modules/bluebird/js/release/promisify.js:311:12)
    at Object.<anonymous> (/github/SAP/openui5-sample-app/node_modules/cacache/lib/verify.js:16:4)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/github/SAP/openui5-sample-app/node_modules/cacache/verify.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
09 04 2020 21:28:25.584:ERROR [karma-server]: Server start failed on port 9876: Error: ui5.framework failed. See error message above
matz3 added a commit to matz3/karma that referenced this issue Apr 9, 2020
Defining fs.statAsync affects other modules such as bluebird which
throws an error because of the 'Async'-suffix:

> Cannot promisify an API that has normal methods with 'Async'-suffix
> See http://goo.gl/MqrFmX

Fixes: karma-runner#3466
johnjbarton pushed a commit that referenced this issue Apr 9, 2020
Defining fs.statAsync affects other modules such as bluebird which
throws an error because of the 'Async'-suffix:

> Cannot promisify an API that has normal methods with 'Async'-suffix
> See http://goo.gl/MqrFmX

Fixes: #3466
@karmarunnerbot
Copy link
Member

🎉 This issue has been resolved in version 5.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

anthony-redFox pushed a commit to anthony-redFox/karma that referenced this issue May 16, 2023
Defining fs.statAsync affects other modules such as bluebird which
throws an error because of the 'Async'-suffix:

> Cannot promisify an API that has normal methods with 'Async'-suffix
> See http://goo.gl/MqrFmX

Fixes: karma-runner#3466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants