'Gulp serve' freezes if there are any syntax errors

Copper Contributor

Hi,

I'm running the latest version of the spfx tool chain on a dev windows server 2012 box.

 

'All of a sudden' the gulp serve task stopped working if syntax errors were hit.

I'm getting a message '(node:18048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): TypeError: options.message.replace is not a function'

 

 

The complete output is:

λ gulp serve                                                                                                                                                                             
Build target: DEBUG                                                                                                                                                                      
[18:37:43] Using gulpfile ~\Documents\Github\react-securityGrid2\gulpfile.js                                                                                                             
[18:37:43] Starting gulp                                                                                                                                                                 
[18:37:43] Starting 'serve'...                                                                                                                                                           
[18:37:43] Starting subtask 'configure-sp-build-rig'...                                                                                                                                  
[18:37:43] Finished subtask 'configure-sp-build-rig' after 10 ms                                                                                                                         
[18:37:43] Starting subtask 'spfx-serve'...                                                                                                                                              
Starting api server on port 5432.                                                                                                                                                        
Registring api: /getwebparts                                                                                                                                                             
Registring api: /*.*                                                                                                                                                                     
Registring api: /workbench                                                                                                                                                               
[18:37:43] Finished subtask 'spfx-serve' after 839 ms                                                                                                                                    
[18:37:43] Starting subtask 'pre-copy'...                                                                                                                                                
[18:37:43] Finished subtask 'pre-copy' after 12 ms                                                                                                                                       
[18:37:43] Starting subtask 'copy-static-assets'...                                                                                                                                      
[18:37:44] Starting subtask 'sass'...                                                                                                                                                    
[18:37:45] Server started https://localhost:4321                                                                                                                                         
[18:37:45] LiveReload started on port 35729                                                                                                                                              
[18:37:45] Opening https://localhost:5432/workbench using the default OS app                                                                                                             
[18:37:45] Finished subtask 'sass' after 1.39 s                                                                                                                                          
[18:37:45] Starting subtask 'tslint'...                                                                                                                                                  
[18:37:47] Starting subtask 'typescript'...                                                                                                                                              
[18:37:47] [typescript] TypeScript version: 2.4.2                                                                                                                                        
[18:37:47] Finished subtask 'copy-static-assets' after 3.15 s                                                                                                                            
  Request: [::1] '/workbench'                                                                                                                                                            
  Request: '/temp/workbench.html'                                                                                                                                                        
[18:37:47] Warning - tslint - src\webparts\securityGrid\components\ISecurityGridProps.ts(3,2): error no-unused-expression: unused expression, expected an assignment or function call    
[18:37:47] Warning - tslint - src\webparts\securityGrid\components\ISecurityGridProps.ts(3,3): error semicolon: Missing semicolon                                                        
  Request: '/node_modules/@microsoft/sp-webpart-workbench/lib/api/workbenchInit.js'                                                                                                      
  Request: '/node_modules/@microsoft/sp-loader/dist/sp-loader-assembly_en-us.js'                                                                                                         
  Request: '/temp/manifests.js'                                                                                                                                                          
[18:37:47] Finished subtask 'tslint' after 2.49 s                                                                                                                                        
[18:37:51] Error - typescript - src\webparts\securityGrid\components\ISecurityGridProps.ts(2,1): error TS2304: Cannot find name 's'.                                                     
[18:37:51] Error - 'typescript' sub task errored after 4.55 s                                                                                                                            
 TypeScript error(s) occurred.                                                                                                                                                           
(node:18048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): TypeError: options.message.replace is not a function                                      

The task then stops and does not respond to any changes I make In the source code. I need to CTRL-C to stop the task an restarting.

 

I tried installing the lts version of node (6.11.4) and the latest version of the spfx generators ( npm install -g @Pernille-Eskebo/generator-sharepoint), but still face the same issue.

 

Anyone know how I can fix this?

2 Replies

I have the exact same issue for the last 2 weeks approximately... Anything we can work on to change that? @Vesa Juvonen are you aware of such problem?

Not aware of any problems like this. I'd suggest reporting this as a potential bug from https://github.com/SharePoint/sp-dev-docs/issues.