Skip to content
This repository was 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
antfu wants to merge 2 commits into
mainfrom
feat/vite-node-render
Closed

feat(vite-node): clear console when rendering error get fixed#6281
antfu wants to merge 2 commits into
mainfrom
feat/vite-node-render

Conversation

@antfu

@antfu antfu commented Aug 1, 2022

Copy link
Copy Markdown
Member

🔗 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

netlify Bot commented Aug 1, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 5a8e9d1
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62e8f540be6efc0008f103d2

@atinux

atinux commented Aug 1, 2022

Copy link
Copy Markdown
Member

How do you test it locally?

@antfu

antfu commented Aug 2, 2022

Copy link
Copy Markdown
Member Author

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

@pi0

pi0 commented Aug 2, 2022

Copy link
Copy Markdown
Member

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

atinux commented Aug 2, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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

pi0 commented Aug 4, 2022

Copy link
Copy Markdown
Member

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