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.

Uncaught Error: URL not found

See original GitHub issue

First off, thanks for creating this! Super exciting project 🙌 Currently migrating a large web app from react-router to navi.

It seems to be an Uncaught Error: URL not found when navigating to a page that doesn’t exist. From the docs I believe the error is supposed to be a NotFoundError so that the <NavNotFoundBoundary /> but it just looks like a generic error based on the console output. The strange thing is that the Error boundary catches the error 🤔

navi: 0.10.5 react-navi: 0.10.6 react: 16.6.0

Because the error message is not present on my Express server (using createMemoryNavigation) it leads me to believe the problem might be related to createBrowserNavigation, but I’m uncertain.

The error is also present on the examples on the Navi docs webpage 👇

screenshot 2019-01-10 at 23 25 14
Full stack trace
Errors.js:24

Uncaught Error: URL not found: /asdf/
    at createNotFoundSegment (Segments.js:38)
    at class_1../node_modules/navi/dist/es/Node.js.NodeMatcher.getResult (Node.js:29)
    at class_1../node_modules/navi/dist/es/Switch.js.SwitchMatcher.execute (Switch.js:121)
    at class_1../node_modules/navi/dist/es/Node.js.NodeMatcher.getResult (Node.js:22)
    at RouteObservable.refresh (RouteObservable.js:28)
    at RouteObservable.handleChange (RouteObservable.js:13)
    at RouteObservable../node_modules/navi/dist/es/RouteObservable.js.RouteObservable.subscribe (RouteObservable.js:51)
    at CurrentRouteObservable../node_modules/navi/dist/es/CurrentRouteObservable.js.CurrentRouteObservable.handleURLChange (CurrentRouteObservable.js:186)
    at CurrentRouteObservable../node_modules/navi/dist/es/CurrentRouteObservable.js.CurrentRouteObservable.refresh (CurrentRouteObservable.js:110)
    at new CurrentRouteObservable (CurrentRouteObservable.js:94)
NaviError	@	Errors.js:24
NotFoundError	@	Errors.js:40
createNotFoundSegment	@	Segments.js:38
./node_modules/navi/dist/es/Node.js.NodeMatcher.getResult	@	Node.js:29
./node_modules/navi/dist/es/Switch.js.SwitchMatcher.execute	@	Switch.js:121
./node_modules/navi/dist/es/Node.js.NodeMatcher.getResult	@	Node.js:22
RouteObservable.refresh	@	RouteObservable.js:28
RouteObservable.handleChange	@	RouteObservable.js:13
./node_modules/navi/dist/es/RouteObservable.js.RouteObservable.subscribe	@	RouteObservable.js:51
./node_modules/navi/dist/es/CurrentRouteObservable.js.CurrentRouteObservable.handleURLChange	@	CurrentRouteObservable.js:186
./node_modules/navi/dist/es/CurrentRouteObservable.js.CurrentRouteObservable.refresh	@	CurrentRouteObservable.js:110
CurrentRouteObservable	@	CurrentRouteObservable.js:94
createCurrentRouteObservable	@	CurrentRouteObservable.js:53
BrowserNavigation	@	BrowserNavigation.js:92
createBrowserNavigation	@	BrowserNavigation.js:44
main$	@	index.js:27
tryCatch	@	runtime.js:65
invoke	@	runtime.js:303
prototype.(anonymous function)	@	runtime.js:117
tryCatch	@	runtime.js:65
invoke	@	runtime.js:155
(anonymous)	@	runtime.js:202
callInvokeWithMethodAndArg	@	runtime.js:201
enqueue	@	runtime.js:224
prototype.(anonymous function)	@	runtime.js:117
./node_modules/regenerator-runtime/runtime.js.runtime.async	@	runtime.js:248
main	@	index.js:26
./src/index.js	@	index.js:72
__webpack_require__	@	bootstrap:68
0	@	commons.js:91567
__webpack_require__	@	bootstrap:68
(anonymous)	@	bootstrap:238
(anonymous)	@	bootstrap:238
Promise.then (async)		
invoke	@	runtime.js:164
(anonymous)	@	runtime.js:202
callInvokeWithMethodAndArg	@	runtime.js:201
enqueue	@	runtime.js:224
prototype.(anonymous function)	@	runtime.js:117
./node_modules/regenerator-runtime/runtime.js.runtime.async	@	runtime.js:248
main	@	index.js:26
./src/index.js	@	index.js:72
__webpack_require__	@	bootstrap:68
0	@	commons.js:91567
__webpack_require__	@	bootstrap:68
(anonymous)	@	bootstrap:238
(anonymous)	@	bootstrap:238


react-dom.development.js:15123

The above error occurred in the <InnerNavContent> component:
    in InnerNavContent (created by Context.Consumer)
    in NavContent
    in InnerNotFoundBoundary (created by Context.Consumer)
    in ErrorBoundary (created by Root)
    in NavProvider (created by Root)
    in IntlProvider (created by LanguageProvider)
    in LanguageProvider (created by Root)
    in Provider (created by Root)
    in Root

React will try to recreate this component tree from scratch using the error boundary you provided, InnerNotFoundBoundary.
logCapturedError	@	react-dom.development.js:15123
logError	@	react-dom.development.js:15157
callback	@	react-dom.development.js:15931
callCallback	@	react-dom.development.js:11194
commitUpdateEffects	@	react-dom.development.js:11233
commitUpdateQueue	@	react-dom.development.js:11224
commitLifeCycles	@	react-dom.development.js:15271
commitAllLifeCycles	@	react-dom.development.js:16523
callCallback	@	react-dom.development.js:149
invokeGuardedCallbackDev	@	react-dom.development.js:199
invokeGuardedCallback	@	react-dom.development.js:256
commitRoot	@	react-dom.development.js:16677
completeRoot	@	react-dom.development.js:18069
performWorkOnRoot	@	react-dom.development.js:17997
performWork	@	react-dom.development.js:17901
performSyncWork	@	react-dom.development.js:17873
requestWork	@	react-dom.development.js:17761
scheduleWork	@	react-dom.development.js:17566
scheduleRootUpdate	@	react-dom.development.js:18240
updateContainerAtExpirationTime	@	react-dom.development.js:18267
updateContainer	@	react-dom.development.js:18324
./node_modules/react-dom/cjs/react-dom.development.js.ReactRoot.render	@	react-dom.development.js:18586
(anonymous)	@	react-dom.development.js:18726
unbatchedUpdates	@	react-dom.development.js:18124
legacyRenderSubtreeIntoContainer	@	react-dom.development.js:18722
render	@	react-dom.development.js:18783
main$	@	index.js:64
tryCatch	@	runtime.js:65
invoke	@	runtime.js:303
prototype.(anonymous function)	@	runtime.js:117
tryCatch	@	runtime.js:65
invoke	@	runtime.js:155
(anonymous)	@	runtime.js:165
Promise.then (async)		
invoke	@	runtime.js:164
(anonymous)	@	runtime.js:202
callInvokeWithMethodAndArg	@	runtime.js:201
enqueue	@	runtime.js:224
prototype.(anonymous function)	@	runtime.js:117
./node_modules/regenerator-runtime/runtime.js.runtime.async	@	runtime.js:248
main	@	index.js:26
./src/index.js	@	index.js:72
__webpack_require__	@	bootstrap:68
0	@	commons.js:91567
__webpack_require__	@	bootstrap:68
(anonymous)	@	bootstrap:238
(anonymous)	@	bootstrap:238

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
renolmachadocommented, Jul 25, 2019

I’ve tested it and works perfectly

2reactions
vongohrencommented, Jun 11, 2019

So I just want to ask a question here, related to this. Im using NotFoundBoundary, but when hitting an URL that is not found, I get my 404, but after some seconds it renders the react yellow page of death with this headline: NotFoundError: URL not found

So @jamesknelson I just wonder what can be done to be sure this works well for my users. Would be nice to have it work as expected in development as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
Basically, it means that the client (your, or your visitor's, web browser) was able to successfully connect to the host (your website's server), ......
Read more >
404 Not Found Error: What It Is and How to Fix It - Airbrake Blog
The most common cause of a 404 Not Found Error is inputting an incorrect URL. Domain names (e.g., airbrake.io) are case-insensitive, meaning ...
Read more >
php - encounter ERROR 404 url not found when establishing ...
encounter ERROR 404 url not found when establishing database connection · if you can list how your files are stored it would be...
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
Reload the page: It might be that the error 404 has appeared for the simple reason that the page did not load properly....
Read more >
URL not found error - Laracasts
URL not found error ... am working on laravel 5.1,am removed public from url based on folder(all root files are move to one...
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