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

Verbose Build option to be able to track down errors #422

Closed
4 tasks done
mythz opened this issue Oct 20, 2021 · 3 comments
Closed
4 tasks done

Verbose Build option to be able to track down errors #422

mythz opened this issue Oct 20, 2021 · 3 comments
Labels
build Related to the build system enhancement New feature or request stale upstream Related to the dependencies

Comments

@mythz
Copy link

mythz commented Oct 20, 2021

Is your feature request related to a problem? Please describe.

I'm getting an opaque build error when trying to build a vitepress site which works without issue during dev (i.e. npm run docs:dev) but fails during build.

$ npm run docs:build
✓ building client + server bundles...
✖ rendering pages...
build error:
 TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at normalizePropsOptions (C:\src\docs\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:2150:15)
    at createComponentInstance (C:\src\docs\node_modules\@vue\runtime-core\dist\runtime-core.cjs.prod.js:4983:23)        
    at renderComponentVNode (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:194:22)      
    at Object.ssrRenderComponent (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:620:12) 
    at _sfc_ssrRender (C:\src\docs\node_modules\vitepress\dist\client\app\temp\wire-format.md.js:12:24)
    at renderComponentSubTree (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:260:13)    
    at renderComponentVNode (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:211:16)      
    at renderVNode (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:301:22)
    at renderVNodeChildren (C:\src\docs\node_modules\@vue\server-renderer\dist\server-renderer.cjs.prod.js:316:9)    

I would like extra info during the build, like which page or component failed to renderer so there's some hope in being able to track it down.

Describe the solution you'd like

Ideally the extra info of what Page and Component failed to render would be included in the error message by default, alternatively being able to run the build with verbose build output, e.g:

$ vitepress build docs --verbose

Describe alternatives you've considered

Couldn't find a way to generate verbose build output, e.g:

$ vitepress build docs --verbose
$ vitepress build docs -v

I wasn't able to find what the supported switches for the build command are, it would be nice if the available command options was available in the standard help options, e.g:

$ vitepress build -h
$ vitepress build --help
$ vitepress build ?

Additional context

No response

Validations

@kiaking kiaking added enhancement New feature or request build Related to the build system labels May 24, 2022
@Jinjiang
Copy link
Member

Jinjiang commented Nov 6, 2022

@Jinjiang
Copy link
Member

Jinjiang commented Nov 6, 2022

FYI. After debugging, I found the reason was an undefined component name in a markdown file. Now, the undefined component name has been deleted. However, it would be great if we could figure out a better error message for this kind of case.

Met the same problem here: vuejs/v3-migration-guide#19 https://app.netlify.com/sites/eager-kowalevski-41f498/deploys/63671c4b5ebaaa0009f899ed

@brc-dd brc-dd added the upstream Related to the dependencies label May 21, 2023
@brc-dd
Copy link
Member

brc-dd commented Jul 27, 2023

EDIT: Following answer is not applicable. The commit was reverted, but we will reintroduce it. It needs some changes in core.

Few updates on this. Vue no longer throws that error during SSR if the component is not registered. So, the builds will succeed fine, however on viewing the site there will be hydration mismatches. So, from next version, one will be able to run vitepress build in slightly more verbose mode by setting DEBUG environment variable to true or any value recognized by the debug package (for example, DEBUG='vitepress:*' or DEBUG='vite:*').

image

@brc-dd brc-dd added upstream Related to the dependencies and removed upstream Related to the dependencies labels Jul 27, 2023
@github-actions github-actions bot added the stale label Sep 16, 2023
@brc-dd brc-dd closed this as completed in f4d4280 Dec 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Related to the build system enhancement New feature or request stale upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

4 participants