Log failure when used with Karma

mohsinulhaq
3
mohsinulhaq
commented 8 months ago
ERROR [karma]: TypeError: this.__write is not a function
    at WriteStream.write (node_modules/webpackbar/dist/utils/log-update.js:89:16)
    at adapters.forEach (node_modules/karma/lib/reporters/base.js:73:16)
    at Array.forEach (<anonymous>)
    at MochaReporter.BaseReporter.write (node_modules/karma/lib/reporters/base.js:68:19)
    at MochaReporter.BaseReporter.writeCommonMsg (node_modules/karma/lib/reporters/base.js:79:16)
    at MochaReporter.BaseReporter.onBrowserLog (node_modules/karma/lib/reporters/base.js:100:12)
    at Server.<anonymous> (node_modules/karma/lib/events.js:40:26)
    at Server.emit (events.js:187:15)
    at Browser.onInfo (node_modules/karma/lib/browser.js:100:20)
    at Socket.socket.on (node_modules/karma/lib/browser.js:272:38)

It seems that your reporter is clashing with Karma's reporter when overriding process.stdout.write. Am I doing something wrong or is this a known issue?

1
apepper
0
apepper
commented 7 months ago

I do have the same issue with version 3.1.4. If I downgrade webpackbar to version 3.0.x (e.g. 3.0.5) the problem vanishes.

It looks like, that https://github.com/nuxt/webpackbar/commit/d51c508ba5a268bd65561076ade9da4ad16b122f introduces the bug.

0
mohsinulhaq
3
mohsinulhaq
commented 7 months ago

hi thanks for the info. Is there any significant feature difference between 3.1.x and 3.0.x? Right now, I have removed the plugin from karma config, but I can downgrade as well.

0
apepper
0
apepper
commented 7 months ago

Is there any significant feature difference between 3.1.x and 3.0.x?

According to https://github.com/nuxt/webpackbar/blob/master/CHANGELOG.md there are some bugfixes and one or two feature improvements.

0
mohsinulhaq
3
mohsinulhaq
commented 7 months ago

I saw that, but I was just asking you if you if there are any noticeable differences. I use it just for the progress bar.

0
apepper
0
apepper
commented 7 months ago

I did not see any noticeable differences. But I did not take a hard look either.

0
mohsinulhaq
3
mohsinulhaq
commented 7 months ago

Alright. Thanks!

0
mohsinulhaq
3
mohsinulhaq
commented 7 months ago

image
just downgraded. I see that now it shows two progress bars, first one remains at 0.

0
apepper
0
apepper
commented 7 months ago

@pi0 : A college of mine also identified a possible patch to fix the problem. See https://github.com/nuxt/webpackbar/commit/d51c508ba5a268bd65561076ade9da4ad16b122f#r31895162 for more details.

0
mohsinulhaq
3
mohsinulhaq
commented 7 months ago

awesome!

0
pi0
31.2k
pi0
commented 7 months ago

I merged #39 and will do some more refactors for using Symbols.

Anyway test runners should NOT use fancy reporter. This is disabled by default unless explicitly set or testing environment does not sets NODE_ENV value to test

0
Informations
Question โ€ข Unresolved
#c31 - Created 8 months ago