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

fix(typescript-build): set logger instance correctly #580

Merged
merged 4 commits into from
Mar 20, 2023

Conversation

rchl
Copy link
Collaborator

@rchl rchl commented Mar 19, 2023

Instead of passing whole Consola instance to fork-ts-checker-webpack-plugin options, which can't be serialized and would crash when trying to use JSON.serialize on it (see how it can happen in the linked issue), pass only an interface with required methods.

Our custom consola was not used AT ALL before this change. It was not set in the correct place so fork-ts-checker-webpack-plugin ignored it completely and just logged errors using console API. So this is also fixed now, in addition to fixing the crash.

Fixes #504

@rchl rchl changed the title fix: crash on serializing consola object fix: crash on serializing consola instance Mar 19, 2023
@codecov
Copy link

codecov bot commented Mar 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d95453e) 100.00% compared to head (56db714) 100.00%.

❗ Current head 56db714 differs from pull request most recent head d5364d5. Consider uploading reports for the commit d5364d5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #580   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           35        36    +1     
  Branches         9         9           
=========================================
+ Hits            35        36    +1     
Impacted Files Coverage Δ
packages/typescript-build/src/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rchl rchl requested a review from danielroe March 19, 2023 18:29
@danielroe danielroe changed the title fix: crash on serializing consola instance fix: set logger instance correctly for fork-ts-checker-webpack-plugin Mar 20, 2023
@danielroe danielroe changed the title fix: set logger instance correctly for fork-ts-checker-webpack-plugin fix(typescript-build): set logger instance correctly Mar 20, 2023
@danielroe danielroe merged commit 96d84f1 into master Mar 20, 2023
@danielroe danielroe deleted the fix/logger-serialization branch March 20, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consola got RangeError because of circular structure conversion in @nuxt/typescript-build
2 participants