File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export const rpc = createBirpc<ServerFunctions>(clientFunctions, {
3535 onError ( error , name ) {
3636 console . error ( `[nuxt-devtools] RPC error on executing "${ name } ":` , error )
3737 } ,
38+ timeout : 120_000 ,
3839} )
3940
4041async function connectWS ( ) {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export function setupRPC(nuxt: Nuxt, options: ModuleOptions) {
3838 onError ( error , name ) {
3939 console . error ( `[nuxt-devtools] RPC error on executing "${ name } ":` , error )
4040 } ,
41+ timeout : 120_000 ,
4142 } ,
4243 )
4344
Original file line number Diff line number Diff line change @@ -88,13 +88,13 @@ export function setupNpmRPC({ nuxt }: NuxtDevtoolsServerContext) {
8888 } )
8989
9090 const execa = process . getProcess ( )
91- await execa
91+ const result = await execa
9292
9393 await Promise . resolve ( )
9494
95- const code = execa . exitCode || 0
95+ const code = result . exitCode
9696 if ( code !== 0 ) {
97- console . error ( String ( execa . stderr ) )
97+ console . error ( result . stderr )
9898 throw new Error ( `Failed to install module, process exited with ${ code } ` )
9999 }
100100
@@ -140,11 +140,16 @@ export function setupNpmRPC({ nuxt }: NuxtDevtoolsServerContext) {
140140 icon : 'carbon:intent-request-uninstall' ,
141141 restartable : false ,
142142 } )
143+ const execa = process . getProcess ( )
144+ const result = await execa
143145
144- await process . getProcess ( )
146+ await Promise . resolve ( )
145147
146- if ( process . getProcess ( ) . exitCode !== 0 )
147- throw new Error ( 'Failed to uninstall module' )
148+ const code = result . exitCode
149+ if ( code !== 0 ) {
150+ console . error ( result . stderr )
151+ throw new Error ( `Failed to uninstall module', process exited with ${ code } ` )
152+ }
148153
149154 await fs . writeFile ( filepath , generated , 'utf-8' )
150155 }
You can’t perform that action at this time.
0 commit comments