[BUG] Cannot read property 'req' of undefined when using serveStatic function
See original GitHub issueIssue
Setup:
- Deno Version: 1.3.0
- v8 Version: 8.6.334
- Typescript Version: 3.9.7
- Opine Version: 0.20.2
After following the tutorial for using Opine with dejs here I get an issue where when I try and load the site it gives an error
Not sure if this is relevant but I’m running Windows 10 2004 x64
Details
I installed deno using the following command in powershell: iwr https://deno.land/x/install/install.ps1 -useb | iex
I then followed the tutorial writing out all the code and went to run it using deno run --allow-net --allow-env --allow-read=./ ./entrypoint.ts
however if I then try and load the page I get the following error displayed instead of my index page:
Exact code used
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Express.js Cannot read property 'req' of undefined
In essence, it listens for a GET request, grab the content query, and then reply with a table. Here's the parts that present...
Read more >Cannot read property 'handle' of undefined · Issue #227 - GitHub
In my case it was due to module adding server middleware directly as a function like so: this.addServerMiddleware((req, res, next) => { ......
Read more >Express.js express.static() Function - GeeksforGeeks
The express.static() function is a built-in middleware function in Express. It serves static files and is based on serve-static. Syntax:
Read more >Cannot read property req body undefined in express - YouTube
codercrab #express #body-parserCannot read property req body undefined in express ||Express req body is undefined for post requests.
Read more >Mongoose - Cannot read property 'push' of undefined-node.js
According to code you are provided, looks like you are using express and req.interview is most probably initialized using app.param() middleware. Please, try ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi @asos-craigmorten thanks for all your work I can confirm opine@0.21.2 fixes the problem and opine now works on windows properly!
So after doing some more research it works completely fine on both Linux and MacOS therefore this seems to be an OS specific issue that only occurs on windows @asos-craigmorten