lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.2k stars 85 forks source link

Middleware error #177

Closed abinici closed 1 year ago

abinici commented 1 year ago

When I run ws I get the following error:

Listening on http://<machinename>.local:8000, http://127.0.0.1:8000, http://10.0.20.102:8000
09:08:31: Middleware error
SyntaxError: invalid JSON, only supports object and array
    at parse (/Users/binici/.nvm/versions/node/v16.15.0/lib/node_modules/local-web-server/node_modules/co-body/lib/json.js:55:13)
    at AsyncFunction.module.exports [as json] (/Users/binici/.nvm/versions/node/v16.15.0/lib/node_modules/local-web-server/node_modules/co-body/lib/json.js:41:20)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async parseBody (/Users/binici/.nvm/versions/node/v16.15.0/lib/node_modules/local-web-server/node_modules/koa-bodyparser/index.js:100:14)
    at async bodyParser (/Users/binici/.nvm/versions/node/v16.15.0/lib/node_modules/local-web-server/node_modules/koa-bodyparser/index.js:85:19)

I even get this error when I run ws without any arguments.

I get this error when using both NodeJS 14 and 16. And I am using local-web-server version 5.2.1.

75lb commented 1 year ago

I can't reproduce this.. do you have a lws.config.js file in your directory? Do you see the same error regardless of which directory you are in? Have you tried reinstalling it?

If this was an issue for all users I would have been flooded with reports by now..

75lb commented 1 year ago

Closing due to lack of feedback..