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

run next dev found some error #4

Closed
zackshen opened this issue Mar 23, 2023 · 2 comments · May be fixed by #6
Closed

run next dev found some error #4

zackshen opened this issue Mar 23, 2023 · 2 comments · May be fixed by #6

Comments

@zackshen
Copy link

hi sam3d,

nice job! the way use websocket is very clean and easy. today i tried this plugin , but found a error in the output log.

this.ensureApiPage is not a function!

can you give a full example ? thank u

env

{
  "name": "ws-demo",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "13.2.4",
    "next-plugin-websocket": "^0.1.2",
    "react": "18.2.0",
    "react-dom": "18.2.0"
  }
}

node = 16.13.2

next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
ready - loaded websocket plugin successfully
event - compiled client and server successfully in 612 ms (168 modules)
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 146 ms (169 modules)
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
wait - compiling / (client and server)...
event - compiled client and server successfully in 206 ms (213 modules)
error - unhandledRejection: TypeError: this.ensureApiPage is not a function

@zackshen
Copy link
Author

I found that must use [email protected] can work correctly.

@yoieh
Copy link

yoieh commented Apr 10, 2023

yoieh added a commit to yoieh/next-plugin-websocket that referenced this issue Apr 10, 2023
This was referenced Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants