Q:

Cannot read property '_id' of null

I get this error:

TypeError:
  /home/application/projetnode/projetnode/views/problemes/edit.ejs:5
      3|         Edit Problem
      4|         

5|             /problemes/<%=probleme._id %>?_method=PUT" method="POST">
          6|                 
          7|
          8|                 

Cannot read property '_id' of null

VIEW probleme ejs
<% include ../partials/header %>
    <div class="row">
        <h1 style="text-align: center">Edit Problem</h1>
        <div style="width: 30%; margin: 25px auto;">
            <form action="/projets/<%= projet_id %>/problemes/<%=probleme._id %>?_method=PUT" method="POST">
                <div class="form-group">

                </div>
                <div class="form-group">
                    <button class="btn btn-lg btn-danger btn-block">Submit!</button>
                </div>
            </form>
        </div>
    </div>
<% include ../partials/footer %>

edit route
  router.get("/:problemeId/edit", middleware.isLoggedIn, function(req, res){
        // find probleme by id
        Projet.findById(req.params.problemeId, function(err, probleme){
            if(err){
                console.log(err);
            } else {
                 res.render("problemes/edit", {projet_id: req.params.id, probleme: probleme});
            }
        })
    });

// route put

router.put("/:problemeId", function(req, res){
   Probleme.findByIdAndUpdate(req.params.problemeId, req.body.probleme, function(err, probleme){
       if(err){
          console.log(err);
           res.render("edit");
       } else {
           res.redirect("/projets/" + req.params.id);
       }
   }); 
});

A:

router.get("/:problemeId/edit", middleware.isLoggedIn, function(req, res){
        // find probleme by id
        Projet.findById(req.params.problemeId, function(err, probleme){
            if(err){
                console.log(err);
            } else {
                 res.render("problemes/edit", {projet_id: req.params.problemeId, probleme: probleme});
            }
        })
    });

You are tring to get projet_id: req.params.id in your edit route but in your get route you have decleared as router.put("/:problemeId", function(req, res) so you have change req.params.id to req.params.problemeId

