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: throw error when router duplicate #1023

Merged
merged 2 commits into from
May 7, 2021
Merged

Conversation

czy88840616
Copy link
Member

增加一个重复路由报错。

image

@gitpod-io
Copy link

gitpod-io bot commented May 1, 2021

@codecov-commenter
Copy link

codecov-commenter commented May 1, 2021

Codecov Report

Merging #1023 (f438b26) into 2.x (5735ccc) will increase coverage by 0.01%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #1023      +/-   ##
==========================================
+ Coverage   85.97%   85.99%   +0.01%     
==========================================
  Files         213      213              
  Lines        8245     8256      +11     
  Branches     1613     1618       +5     
==========================================
+ Hits         7089     7100      +11     
  Misses       1107     1107              
  Partials       49       49              
Impacted Files Coverage Δ
packages/core/src/util/webRouterCollector.ts 94.30% <93.75%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5735ccc...f438b26. Read the comment docs.

@czy88840616 czy88840616 merged commit 61bc58d into 2.x May 7, 2021
@czy88840616 czy88840616 deleted the fix_router_duplicate branch May 7, 2021 03:11
@Dreamer-Paul
Copy link

Dreamer-Paul commented May 22, 2022

鄙人今天就遇到了重复的问题,请问怎么检查具体是哪个文件影响导致的重复?目录结构内确实存在同名但位置不同的文件

api
- admin
-- acgm
--- add.ts
- acgm.ts

会是这个原因引起的么,这个不应该算是路由重复吧,开发环境下一切正常

POST /api/admin/acgm/add
GET /api/acgm

试了下改 admin/acgm 的路由名称重新部署无效,发现是项目迭代原因所致,/api/acgm 曾经是个目录,但后期变回了文件,旧的文件不会随着部署自动清理,删除掉 dist 重新生成就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants