question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Cannot read property 'req' of undefined when using serveStatic function

See original GitHub issue

Issue

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: image

Exact code used

https://github.com/futurelucas4502/Opine-dejs

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

2reactions
futurelucas4502commented, Aug 18, 2020

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!

2reactions
futurelucas4502commented, Aug 17, 2020

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 image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found