actionhero / actionhero-chat

An example Actionhero application using seqeulize and next.js
https://chat.actionherojs.com
2 stars 1 forks source link

npm run dev will not come up #182

Closed mfvargo closed 3 years ago

mfvargo commented 3 years ago

I'm not sure if this is an issue with this chat app or with ah-next-plugin. I installed this on my local linux machine.

Linux: Version 20.10 (Groovy Gorilla) npm: 6.13.7 node: v12.19.0

When I try to run it via "npm run dev" it boots up but gets an error in jest-worker which seems to be pulled in by next ( looking in package-lock.json)

Server boots fine with npm start.

I tried to google this error but came up empty.

mfvargo@mikedell:~/projects/actionhero-chat$ npm run dev
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/3292/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> actionhero-chat@0.1.0 dev /home/mfvargo/projects/actionhero-chat
> cd api && ts-node-dev --ignore-watch ../web ./src/server.ts

[INFO] 22:27:07 ts-node-dev ver. 1.1.6 (using ts-node ver. 9.1.1, typescript ver. 4.2.3)
2021-04-07T05:27:10.856Z - notice: pid: 341535 
2021-04-07T05:27:10.857Z - notice: environment: development 
2021-04-07T05:27:10.857Z - info: *** Starting Actionhero *** 
2021-04-07T05:27:10.859Z - info: Running next in development mode... 
2021-04-07T05:27:11.074Z - info: actionhero member 192.168.250.1 has joined the cluster 
2021-04-07T05:27:11.257Z - info: UNCAUGHT EXCEPTION: TypeError: Unexpected response from worker: undefined
    at ChildProcessWorker._onMessage (/home/mfvargo/projects/actionhero-chat/node_modules/jest-worker/build/workers/ChildProcessWorker.js:264:15)
    at ChildProcess.emit (events.js:326:22)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21) 
2021-04-07T05:27:11.257Z - notice: stopping process... 
[ERROR] 22:27:11 TypeError: Unexpected response from worker: undefined
2021-04-07T05:27:11.358Z - notice: Stopping server: web 
2021-04-07T05:27:11.358Z - notice: Stopping server: websocket 
Process did not terminate within 30000ms. Stopping now!
^C

When I do "npm start"

mfvargo@mikedell:~/projects/actionhero-chat$ npm start
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/3292/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> actionhero-chat@0.1.0 start /home/mfvargo/projects/actionhero-chat
> cd api && node ./dist/server.js

2021-04-07T07:07:32.316Z - notice: pid: 352418 
2021-04-07T07:07:32.317Z - notice: environment: development 
2021-04-07T07:07:32.317Z - info: *** Starting Actionhero *** 
2021-04-07T07:07:32.319Z - info: Running next in development mode... 
2021-04-07T07:07:32.527Z - info: actionhero member 192.168.250.1 has joined the cluster 
info  - Using webpack 4. Reason: future.webpack5 option not enabled https://nextjs.org/docs/messages/webpack5
info  - Using external babel configuration from /home/mfvargo/projects/actionhero-chat/web/.babelrc.js
event - compiled successfully
2021-04-07T07:07:40.520Z - notice: Starting server: `web` @ 0.0.0.0:8080 
2021-04-07T07:07:40.523Z - notice: Starting server: `websocket` 
2021-04-07T07:07:41.463Z - notice: server ID: 192.168.250.1 
2021-04-07T07:07:41.463Z - notice: *** Actionhero Started *** 
event - build page: /next/dist/pages/_error
wait  - compiling...
event - compiled successfully
event - build page: /
wait  - compiling...
event - compiled successfully
2021-04-07T07:07:43.943Z - info: [ file @ web ] to=127.0.0.1 file=/home/mfvargo/projects/actionhero-chat/web/public/javascript/ActionheroWebsocketClient.min.js requestedFile=javascript/ActionheroWebsocketClient.min.js size=36639 duration=4 success=true 
2021-04-07T07:07:44.587Z - info: [ action @ web ] to=127.0.0.1 action=status params={"action":"status","apiVersion":"1"} duration=6 

All is good in the world.

I have another project that also using ah-next-plugin and it exhibits the same phenom. rtjam-nation

mfvargo commented 3 years ago

Nevermind. I found the note about this in ah-next-plugin readme.

https://github.com/actionhero/ah-next-plugin#dev-command-alternative

that fixed the issue straight away.