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

chore: cherry pick for v4 #14520

Merged
merged 20 commits into from
Oct 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0f7ae2f
fix(glob): trigger HMR for glob in a package (#14117)
sapphi-red Aug 16, 2023
917ff3f
fix: ws never connects after restarting server if server.hmr.server i…
sapphi-red Aug 16, 2023
65df270
fix: initWasm options should be optional (#14152)
btea Aug 18, 2023
eda46c3
fix: if host is specified check whether it is valid (#14013)
btea Aug 22, 2023
76dd2f9
fix: use string manipulation instead of regex to inject esbuild helpe…
fnlctrl Aug 25, 2023
8c35aad
fix: handle sourcemap correctly when multiple line import exists (#14…
sapphi-red Aug 29, 2023
1837415
fix(vite): precisely check if files are in dirs (#14241)
danielroe Sep 3, 2023
e6c89d7
fix: add source map to Web Workers (fix #14216) (#14217)
yume-chan Sep 3, 2023
c1db72a
fix(cli): convert special base (#14283)
btea Sep 4, 2023
be9201e
fix(css): remove pure css chunk sourcemap (#14290)
sun0day Sep 5, 2023
d8529f9
fix: include `vite/types/*` in exports field (#14296)
yuheiy Sep 6, 2023
4680cba
fix(optimizer): define crawlDeps after scanProcessing and optimizatio…
anyesu Sep 6, 2023
50d2e4a
fix(css): reset render cache on renderStart (#14326)
bluwy Sep 8, 2023
e1c365c
fix(manifest): preserve pure css chunk assets (#14297)
sun0day Sep 10, 2023
4b1c92d
feat: improve deno and bun support (#14379)
bluwy Sep 18, 2023
cf60551
fix: handle errors during `hasWorkspacePackageJSON` function (#14394)
sapphi-red Sep 18, 2023
e6213c1
fix(import-analysis): preserve importedUrls import order (#14465)
bluwy Sep 26, 2023
ae7b4cd
fix(analysis): warnings for dynamic imports that use static template …
Dunqing Sep 28, 2023
56c5f4f
fix(resolve): support submodules of optional peer deps (#14489)
decs Oct 2, 2023
1be88ab
fix: restore builtins list
bluwy Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: handle errors during hasWorkspacePackageJSON function (#14394)
  • Loading branch information
sapphi-red authored and bluwy committed Oct 3, 2023
commit cf605519d8ab02523cf918609f0705e30a5741d1
8 changes: 6 additions & 2 deletions packages/vite/src/node/server/searchRoot.ts
Original file line number Diff line number Diff line change
@@ -27,8 +27,12 @@ function hasWorkspacePackageJSON(root: string): boolean {
if (!isFileReadable(path)) {
return false
}
const content = JSON.parse(fs.readFileSync(path, 'utf-8')) || {}
return !!content.workspaces
try {
const content = JSON.parse(fs.readFileSync(path, 'utf-8')) || {}
return !!content.workspaces
} catch {
return false
}
}

function hasRootFile(root: string): boolean {