ReferenceError: req is not defined
See original GitHub issuewrangler pages dev --proxy 8090 -- astro dev --verbose
results in
[HPM] Proxy created: / -> http://127.0.0.1:40527
[HPM] Proxy created: / -> http://127.0.0.1:8090
Serving at http://127.0.0.1:8788/
/blog/node_modules/wrangler/wrangler-dist/index_node.js:27064
throw ex;
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ReferenceError: req is not defined".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Running:
"resolved": "https://registry.npmjs.org/wrangler/-/wrangler-0.0.0-fsw-beta.5.tgz",
(inside docker nodejs container)
and for _worker.js
export default {
async fetch(request, env) {
if (req.url.startsWith('/api/')) {
// TODO: Custom /api/* Worker logic
return new Response('TODO: add logic')
}
// Otherwise, serve static asset(s).
// Without this, Worker will error and no assets will be served.
return env.ASSETS.fetch(request)
}
}```
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Node "req is not defined" - Stack Overflow
You probably mismatched the frameworks. Pure HTTP has request in handler specified in createServer. req is specific for the Express framework.
Read more >req is not defined in NodeJS application - dark-hamster
How to Solve Error Message ReferenceError: req is not defined in NodeJS application ... Actually, it is a part for returning a value...
Read more >Newbie help: ReferenceError: req is not defined : r/node - Reddit
Hi guys! I am not sure how to get this solved, I have gone through Stackoverflow and some other resources, most of them...
Read more >ReferenceError: request is not defined (Example) - Treehouse
Has anyone encountered the error 'ReferenceError: request is not defined' when trying to follow the get method example?
Read more >Node.js req.query Not Defined in PhpStorm
ReferenceError : req is not defined at Object.<anonymous> (C:\Users\me\PhpstormProjects\myprojectname\index.js:4:13) at Module.
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
(we should still do a better job of showing that error outside of the Promise rejection)
Yeah, I saw haha. Too quick for me