Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Cannot match any routes. URL Segment: 'robots.txt' #654

Open
apoklyak opened this issue Nov 28, 2018 · 2 comments
Open

Cannot match any routes. URL Segment: 'robots.txt' #654

apoklyak opened this issue Nov 28, 2018 · 2 comments

Comments

@apoklyak
Copy link

apoklyak commented Nov 28, 2018

I downloaded this Angular universal starter.

Installed all dependencies from package.json and tried to launch project. For first I ran 'ng build' command and after that ran next command "npm run build:ssr && npm run serve:ssr"

All works well, but sometimes I catch in terminal next message:

ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'robots.txt'
Error: Cannot match any routes. URL Segment: 'robots.txt'
    at ApplyRedirects.noMatchError (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2557:20)
    at CatchSubscriber.selector (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2538:33)
    at CatchSubscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\catchError.js:48:31)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at TapSubscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\tap.js:75:26)
    at resolvePromise (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:814:31)
    at resolvePromise (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:771:17)
    at D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:873:17
    at ZoneDelegate.invokeTask (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:421:31)
    at Object.onInvokeTask (D:\universal-starter-master\universal-starter-master\node_modules\@angular\core\bundles\core.umd.js:16177:37)
    at ZoneDelegate.invokeTask (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:420:36)
    at Zone.runTask (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:188:47)
    at drainMicroTaskQueue (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:595:35)
    at ZoneTask.invokeTask (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:500:21)
    at ZoneTask.invoke (D:\universal-starter-master\universal-starter-master\node_modules\zone.js\dist\zone-node.js:485:48)
  rejection: Error: Cannot match any routes. URL Segment: 'robots.txt'
    at ApplyRedirects.noMatchError (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2557:20)
    at CatchSubscriber.selector (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2538:33)
    at CatchSubscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\catchError.js:48:31)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at TapSubscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\tap.js:75:26),
  promise:
   ZoneAwarePromise {
     __zone_symbol__state: 0,
     __zone_symbol__value: Error: Cannot match any routes. URL Segment: 'robots.txt'
    at ApplyRedirects.noMatchError (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2557:20)
    at CatchSubscriber.selector (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2538:33)
    at CatchSubscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\catchError.js:48:31)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at TapSubscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\tap.js:75:26) },
  zone:
   Zone {
     _properties: { isAngularZone: true },
     _parent:
      Zone {
        _properties: {},
        _parent: null,
        _name: '<root>',
        _zoneDelegate: [Object] },
     _name: 'angular',
     _zoneDelegate:
      ZoneDelegate {
        _taskCounts: [Object],
        zone: [Circular],
        _parentDelegate: [Object],
        _forkZS: null,
        _forkDlgt: null,
        _forkCurrZone: [Object],
        _interceptZS: null,
        _interceptDlgt: null,
        _interceptCurrZone: [Object],
        _invokeZS: [Object],
        _invokeDlgt: [Object],
        _invokeCurrZone: [Circular],
        _handleErrorZS: [Object],
        _handleErrorDlgt: [Object],
        _handleErrorCurrZone: [Circular],
        _scheduleTaskZS: [Object],
        _scheduleTaskDlgt: [Object],
        _scheduleTaskCurrZone: [Circular],
        _invokeTaskZS: [Object],
        _invokeTaskDlgt: [Object],
        _invokeTaskCurrZone: [Circular],
        _cancelTaskZS: [Object],
        _cancelTaskDlgt: [Object],
        _cancelTaskCurrZone: [Circular],
        _hasTaskZS: [Object],
        _hasTaskDlgt: [Object],
        _hasTaskDlgtOwner: [Circular],
        _hasTaskCurrZone: [Circular] } },
  task:
   ZoneTask {
     _zone:
      Zone {
        _properties: [Object],
        _parent: [Object],
        _name: 'angular',
        _zoneDelegate: [Object] },
     runCount: 0,
     _zoneDelegates: null,
     _state: 'notScheduled',
     type: 'microTask',
     source: 'Promise.then',
     data:
      ZoneAwarePromise {
        __zone_symbol__state: 0,
        __zone_symbol__value: Error: Cannot match any routes. URL Segment: 'robots.txt'
    at ApplyRedirects.noMatchError (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2557:20)
    at CatchSubscriber.selector (D:\universal-starter-master\universal-starter-master\node_modules\@angular\router\bundles\router.umd.js:2538:33)
    at CatchSubscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\catchError.js:48:31)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at MapSubscriber.Subscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:93:26)
    at MapSubscriber.Subscriber.error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\Subscriber.js:73:18)
    at TapSubscriber._error (D:\universal-starter-master\universal-starter-master\node_modules\rxjs\internal\operators\tap.js:75:26) },
     scheduleFn: undefined,
     cancelFn: null,
     callback: [Function],
     invoke: [Function] } }

How can I fix this? To catch this message I click on the refresh button in the browser much times.

@alikarimii
Copy link

alikarimii commented Dec 8, 2018

go to /dist/browser and create file robots.txt

All static file must be in /dist/browser
app.get('*.*', express.static(join(DIST_FOLDER, 'browser')));

@Gorniv
Copy link

Gorniv commented Dec 14, 2018

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

No branches or pull requests

3 participants