I just updated EJS from 2.7.4 to 3.1.5 and some other packages in my project. Upon doing it, I can't access any of the webpages but getting an error instead. Apparently all of the pages throws the same error. Besides that I get VS Code errors in some of the code in my ejs template which didn't matter before. I mean the errors were there before I updated all the npm packages and the app worked perfectly fine.
This is the endpoint:
router.get("/", async (req, res) => {
try{
const url = `http://api.example.co/?key=${process.env.API_KEY}`;
const fullData = await axios.get(url);
res.render("../views/index", {data: fullData});
}catch(err) {
res.render("../views/index", {data: null});
}
});
This is how I get data in my ejs template:
<% if(data){ %>
Name <%= data.name %>
<% } %>
This is the code in my script tags in my ejs template which shows red underline:

<script type="text/javascript" >
<% if(data) { %>
var map = L.map('map').setView([<%= data.latitude %>, <%= data.longitude %>], 11);
var marker = L.marker([<%= data.latitude %>, <%= data.longitude %>]).addTo(map);
L.tileLayer('https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=boomBoomBoomm', {
attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>'
}).addTo(map);
<% } %>
</script>
What could be the issue? Am I doing something wrong? Is the update of something clashing with something else? Please help!
