You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @flowimporttype{$Request,$Response}from'express';consthbs=require("hbs");constexpress=require("express");constapp=express();app.set("view engine","hbs");console.log(__dirname+"/views");app.set("views",__dirname+"/views");// $@FlowFixMeconsthttp=require("http").Server(app);constio=require('socket.io')(http);io.on("connection",()=>{console.log("new user connected");});app.get('/',(req: $Request,res: $Response)=>{res.render("index");});http.listen(8300,()=>{console.log("Server running on 8300");});
flow output:
PS C:\temp\express-hbs> flow
server/index.js:4
4: const hbs = require("hbs");
^^^^^ hbs. Required module not found
server/index.js:12
12: const http = require("http").Server(app);
^^^^^^ property `Server`. Property not found in
12: const http = require("http").Server(app);
^^^^^^^^^^^^^^^ module `http`
server/index.js:13
13: const io = require('socket.io')(http);
^^^^^^^^^^^ socket.io. Required module not found
Found 3 errors
So the .Server thing can be ignored by the $FlowFixMe but how can I tell flow to be cool with socket.io? There are no definition files for socket.io or hbs.
I'd like some workarounds and I'm not sure what my options are here.
The text was updated successfully, but these errors were encountered:
I'm having some errors with the following code
flow output:
So the
.Server
thing can be ignored by the$FlowFixMe
but how can I tell flow to be cool withsocket.io
? There are no definition files for socket.io or hbs.I'd like some workarounds and I'm not sure what my options are here.
The text was updated successfully, but these errors were encountered: