Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set property 'statusCode' of undefined #30

Closed
frederikhors opened this issue Jun 8, 2019 · 4 comments
Closed

Cannot set property 'statusCode' of undefined #30

frederikhors opened this issue Jun 8, 2019 · 4 comments

Comments

@frederikhors
Copy link

frederikhors commented Jun 8, 2019

Many times when I open my browser waiting for the sirv server to start it gives an error like this in console:

rollup v1.14.4
bundles src/main.js → dist...
LiveReload enabled
C:\project\node_modules\sirv-cli\boot.js:40
                opts.onNoMatch = (req, res) => (req.path='/',fn(req, res, r => (r.statusCode=404,r.end())));
                                                                                            ^

TypeError: Cannot set property 'statusCode' of undefined
    at r (C:\project\node_modules\sirv-cli\boot.js:40:79)
    at C:\project\node_modules\sirv\index.js:93:18
    at opts.onNoMatch (C:\project\node_modules\sirv-cli\boot.js:40:48)
    at Server.<anonymous> (C:\project\node_modules\sirv\index.js:93:27)
    at Server.emit (events.js:203:15)
    at parserOnIncoming (_http_server.js:677:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)

I'm using sveltejs/template (rollup one)

and running from a package.json script like this:

"start:dev": "sirv dist --dev -s".

If I close my browser page and try to re-run everything works again!

@lukeed
Copy link
Owner

lukeed commented Jun 8, 2019

Do you have latest version installed?

@frederikhors
Copy link
Author

"sirv-cli": "0.4.3"

@lukeed
Copy link
Owner

lukeed commented Jun 8, 2019

Yeah, I see the problem. I already fixed this But forgot it was in the next branch. That's why I asked, sorry

How fast track it for master fix

@lukeed
Copy link
Owner

lukeed commented Jun 8, 2019

Nevermind, the actual fix was much simpler so only needed to patch that part :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants