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

"File not found: undefined" on a brand new project #800

Closed
1 of 3 tasks
peterbe opened this issue Aug 25, 2021 · 7 comments
Closed
1 of 3 tasks

"File not found: undefined" on a brand new project #800

peterbe opened this issue Aug 25, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@peterbe
Copy link

peterbe commented Aug 25, 2021

Describe the bug
Can't go to http://localhost:8080 after having npm start.

Screen Shot 2021-08-25 at 11 04 39 AM

To Reproduce
Steps to reproduce the behavior:

  1. cd /tmp
  2. npm init wmr repro-overlay-bug
  3. cd repro-overlay-bug
  4. npm start
  5. open http://localhost:8080

Note that I haven't touched any files at all. Just run npm init and npm start.

Expected behavior
I can actually see the sample Home page that is built for a split second but then it goes away.
Running npm run build and PORT=8080 npm run serve followed by going to http://localhost:8080 works fine.

Bug occurs with:

  • wmr or wmr start (development)
  • wmr build (production)
  • wmr serve

Desktop (please complete the following information):

  • OS: macOS 11.5
  • Browser: latest chrome and firefox
  • Node Version: v16.3.0
  • WMR Version: 3.5.1

Additional context

We really should have a GitHub Action that tests npm start and going to the sample app in debug mode. It would have caught this bug.

@peterbe peterbe added the bug Something isn't working label Aug 25, 2021
@developit
Copy link
Member

Interesting. Any idea what file it's looking for? There should be verbose output in the terminal if you run DEBUG=true wmr.

@marvinhagemeister
Copy link
Member

Just checked on my linux box and there it works fine. Maybe it's an OS dependent thing?

@rschristian
Copy link
Member

Or an existing attached service worker perhaps?

@peterbe
Copy link
Author

peterbe commented Aug 25, 2021

Or an existing attached service worker perhaps?

That would make a LOT of sense because I was hacking on a preactcli app, in the same browser, and it's using localhost:8080 too.
It's always something with these service workers!

I wish the error could have been better. ...until I get the same intuition as @rschristian.

Shall I close this or shall we morph it to be about a rogue service worker and the poor error message?

PS. Simply going into the devtools and unregistering the existing service worker makes it so the site works again.

@peterbe
Copy link
Author

peterbe commented Aug 25, 2021

Besides, I should have figured it was service workers because I did get:

404 ./public/sw-debug.js - File not found

on the stdout.

@rschristian
Copy link
Member

Yeah I'm thinking it might be worth creating a special case for & automatically unregistering /sw-debug.js. A few people have run into it now and there's going to be obvious overlap in preact-cli and wmr users.

Not sure if that's going to interfere with any users though.

@marvinhagemeister
Copy link
Member

Fixed with #802 . We'll cut a new release for wmr soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants