fix: resolve dev server startup failures (route name conflict + eslint abort) - #22
Open
Shevon37 wants to merge 1 commit into
Open
fix: resolve dev server startup failures (route name conflict + eslint abort)#22Shevon37 wants to merge 1 commit into
Shevon37 wants to merge 1 commit into
Conversation
…t abort)
Two bugs block 'yarn dev' on a fresh clone:
1) Vue Router name conflict (white screen)
src/router/modules/{editor,home,template}.ts declared a child route with the
same 'name' as its parent, which Vue Router 4 forbids. Renamed child routes to
'<parent>Index' (e.g. editor -> editorIndex), matching the convention already
used by the syntax/update modules.
2) eslint aborts the dev server on first run
vite-plugin-eslint runs with lintOnStart: true, but the auto-generated
declaration files auto-imports.d.ts / components.d.ts were not ignored by eslint,
so the prettier formatting error inside the generated file aborted vite's
buildStart and killed the server. Added them (and .eslintrc.cjs) to
.eslintignore and .prettierignore.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent bugs currently prevent
yarn devfrom starting on a fresh clone. Both are reproduced consistently and fixed here.Bug 1 — Vue Router name conflict (white screen)
src/router/modules/{editor,home,template}.tsdeclared a child route with the samenameas its parent. Vue Router 4 forbids nested routes sharing a name with an ancestor, socreateRouterthrows at startup and the whole app fails to mount (white screen).Renamed the child routes to
<parent>Index(e.g.editor→editorIndex), matching the convention already used by thesyntax/updatemodules (syntaxHelper,updateLine).src/router/modules/editor.ts: childeditor→editorIndexsrc/router/modules/home.ts: childhome→homeIndexsrc/router/modules/template.ts: childtemplate→templateIndexBug 2 — eslint aborts the dev server on first run
vite-plugin-eslintruns withlintOnStart: true, but the auto-generated declaration filesauto-imports.d.ts/components.d.tswere not covered by.eslintignore. The prettier formatting error inside the generated file aborts Vite'sbuildStartand kills the server before it ever starts.Added
auto-imports.d.ts,components.d.ts, and.eslintrc.cjsto both.eslintignoreand.prettierignore. (.gitignorealready ignores these generated files, so this is the correct scope.)Test plan
yarn devnow reachesVITE readywithout a route-name erroryarn devno longer aborts due to the generatedauto-imports.d.tsprettier errorsrc/router/modules/*(no duplicates, no parent/child name collisions)Fixes # (many first-time users hit this on clone)