vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.32k stars 1.01k forks source link

socket.io 404 in nestjs #689

Closed GuanglongDu closed 5 years ago

GuanglongDu commented 5 years ago

Hello i build https://github.com/nestjs/nest/tree/master/sample/02-gateways in pkg, i connected socket.io throws 404 error in html , but it could connected when npm start in command , how could i resolve this?

Thanks.

DanStory commented 5 years ago

I resolved this same issue by adding the @nestjs/websockets module folder to pkg's assets via package.json.

"pkg": {
    "assets": [
      "node_modules/@nestjs/websockets/**/*"
    ]
  }
nickhaughton commented 5 years ago

I am having the same issue, the above fix doesn't work for me

GuanglongDu commented 5 years ago

@DanStory It works, Thanks.

pascalbayer commented 5 years ago

@GuanglongDu How did you fix that issue in your case? Doesn't work for me if I simply put the assets statement in the package.json

EDIT: I figured it out. You need to put all the config into your package.json file to make it work. Is there a way to provide the assets via cli param?

db2crush commented 5 years ago

@DanStory Thanks. You saved me.