Skip to content

Issue with context parameters, SW.js returned?! #36290

Answered by icyJoseph
Rodeveer asked this question in Help
Discussion options

You must be logged in to vote

Catch all routes are very aggressive, and a top level catch all route will indeed, catch absolutely everything.

In your case a request for a service worker is arriving at Next.js.

Say for example that there's no public/favicon.ico file available in your public folder.

The catch all route, will then kick in and uid will be favicon.ico.

Again, in your case, the browser seems to have saved a service worker and it is making a request to get it.

You ought to be extremely careful with catch all routes at the root of the application, as they'll swallow most things.

You can use the resolvedUrl in the getServerSideProps handler context, to decide whether or not you are faced with a valid request. …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Rodeveer
Comment options

@icyJoseph
Comment options

@Rodeveer
Comment options

@icyJoseph
Comment options

@Rodeveer
Comment options

Answer selected by Rodeveer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants