Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(vite-node): clear console when rendering error get fixed #6281

Closed
wants to merge 2 commits into from

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 1, 2022

πŸ”— Linked issue

fix nuxt/nuxt#13914

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Aug 1, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 5a8e9d1
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62e8f540be6efc0008f103d2

@atinux
Copy link
Member

atinux commented Aug 1, 2022

How do you test it locally?

@antfu
Copy link
Member Author

antfu commented Aug 2, 2022

You can add a throw new Error in <script setup> to trigger SSR error and then remove it.

@pi0
Copy link
Member

pi0 commented Aug 2, 2022

Nice idea to only clear console when there are errors but i think we can do it with main consola instance wrapping console in nuxi to catch all sources of warning and error.

As for this PR, can we show a message when we detect vite-node assets are changed in next render? Currently there is no watcher and message like client-side indicating HMR happened or legacy vite builder. Do we still have a watcher with vite-node ?

@atinux
Copy link
Member

atinux commented Aug 2, 2022

I may do something wrong but I don't see the clear (also got the server stuck at one point):

Screenshot.2022-08-02.at.17.12.17.mp4

previousError = ssrContext.error
} else if (previousError) {
previousError = null
consola.clear()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't works to clear screen. consola.clear was legacy name for consola. removeReporter.

Also we probably shouldn't clear screen from runtime.

@pi0 pi0 mentioned this pull request Aug 4, 2022
7 tasks
@pi0
Copy link
Member

pi0 commented Aug 4, 2022

Thanks to #6343, we can now show accurate message on HMR. Moving log enhancenment to #6351. And lets track clear on rebuild experience in nuxt/nuxt#13914. I think we could handle it on nuxi level.

@pi0 pi0 closed this Aug 4, 2022
@pi0 pi0 deleted the feat/vite-node-render branch August 4, 2022 10:23
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clear console on HMR
4 participants