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.

Empty URL in resolver.

See original GitHub issue

Describe the bug

I spent a lot of time to get why my url don’t mock. The reason is empty URL.

image

im sending request to /dev/api/v1/auth/login but console.log(req.url) show in terminal empty URL {} object:

image

Environment

  • msw: 0.21.3
  • nodejs: 14.14.0
  • npm: 6.14.18

Please also provide your browser version. Im using JEST tests. There is no browser running.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
olegKusovcommented, Oct 26, 2020

You don’t need MSW update: it specifies node-request-interceptor dependency version range permissive enough to pull in a patched version release:

https://github.com/mswjs/msw/blob/327b384938b1fdf44e77c5bd79e91b7fab0aaad4/package.json#L73

“^0.5.1” will install “0.5.1” as well as “0.5.3” (“0.5.x”)

Neither you should install that 4th party dependency manually. Please reinstall your dependency and the new version of node-request-interceptor will be automatically installed. You can verify that by running the following command after the installation:

$ npm ls node-request-interceptor

It works! Thank you! I close issue.

2reactions
kettanaitocommented, Oct 25, 2020

One of the contributors has discovered an issue in node-request-interceptor, when we didn’t inherit the default hostname in certain scenarios (https://github.com/mswjs/node-request-interceptor/pull/64). This would also cause a URL like http://undefined. Let’s keep this in mind until we receive a confirmation from the author on the URL validity on his side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Activated Route URL Always Empty - Stack Overflow
Every time the route changes, the console.log() triggers. But, no matter what the route, the value is always "" (empty string). What is...
Read more >
Base URL malformed or empty - Sitebulb
Base URL malformed or empty. This means that the URL in question contains a base URL which is malformed or empty. Why is...
Read more >
Empty Url Segment in Route Template - MSDN - Microsoft
Im having an issue defining the correct route template to handle an request with an emtpy url segment. Either that or this is...
Read more >
2.6 URLs — HTML5 - W3C
A string is a valid non-empty URL potentially surrounded by spaces if, after stripping leading and trailing whitespace from it, it is a...
Read more >
What should a link resolver do when a document type ...
I think it would be good if link resolvers could return null (or undefined , whatever you prefer) in cases where there is...
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