File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -329,8 +329,17 @@ function hasWebServerDependency(targetProjectData: TargetProjectData): boolean {
329329 let projectJson = fs . readFileSync ( targetProjectData . projectJsonPath , 'utf8' ) ;
330330 projectJson = projectJson . replace ( / ^ \uFEFF / , '' ) ;
331331
332- let projectJsonObject = JSON . parse ( projectJson ) ;
333-
332+ let projectJsonObject : any ;
333+
334+ try {
335+ // TODO: This error should be surfaced to the user. If the JSON can't be parsed
336+ // (maybe due to a syntax error like an extra comma), the user should be notified
337+ // to fix up their project.json.
338+ projectJsonObject = JSON . parse ( projectJson ) ;
339+ } catch ( error ) {
340+ projectJsonObject = null ;
341+ }
342+
334343 if ( projectJsonObject == null ) {
335344 return false ;
336345 }
You can’t perform that action at this time.
0 commit comments