Skip to content

Commit 1b1b919

Browse files
feat(overmind): add error message for devtools issue
1 parent e6a61cd commit 1b1b919

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

packages/node_modules/overmind/src/Devtools.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { IS_PROXY } from 'proxy-state-tree'
21
import isPlainObject from 'is-plain-obj'
2+
import { IS_PROXY } from 'proxy-state-tree'
33

44
export type Message = {
55
type: string
@@ -59,7 +59,16 @@ export class Devtools {
5959
this.isConnected = true
6060
this.sendBuffer()
6161
}
62-
this.ws.onerror = () => {}
62+
this.ws.onerror = () => {
63+
console.error(
64+
`OVERMIND DEVTOOLS: Not able to connect. You are trying to connect to "${host}", but there was no devtool there. Try the following:
65+
66+
- Make sure you are running the latest version of the devtools, using "npx overmind-devtools@latest" or install latest extension for VSCode
67+
- Close the current tab and open a new one
68+
- Make sure the correct port is configured in the devtools
69+
`
70+
)
71+
}
6372
this.ws.onclose = () => {
6473
this.isConnected = false
6574

0 commit comments

Comments
 (0)