Home > Net >  Angular Universal Deployment on Cpanel
Angular Universal Deployment on Cpanel

Time:03-25

I Deploy my angular SSR Code on Cpanel and got this error using this link

https://www.purcellyoon.com/insights/articles/angular-universal-server-side-rendering-ssr-with-cpanel-whm

Link is working find when i did

node dist/project/server/main.js
Node Express server listening on http://localhost:4000

When I hit domain on browser the terminal give below error.

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'index.php'
Error: Cannot match any routes. URL Segment: 'index.php'
    at router_ApplyRedirects.noMatchError (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553577)
    at catchError_CatchSubscriber.selector (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553228)
    at catchError_CatchSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2510066)
    at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
    at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
    at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
    at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
    at ThrowIfEmptySubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
    at ThrowIfEmptySubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
    at TakeLastSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
    at resolvePromise (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1236381)
    at resolvePromise (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1235368)
    at /home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1238055
    at ZoneDelegate.invokeTask (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1220630)
    at Object.onInvokeTask (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1688527)
    at ZoneDelegate.invokeTask (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1220520)
    at Zone.runTask (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1213195)
    at drainMicroTaskQueue (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:1224238) {
  rejection: Error: Cannot match any routes. URL Segment: 'index.php'
      at router_ApplyRedirects.noMatchError (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553577)
      at catchError_CatchSubscriber.selector (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553228)
      at catchError_CatchSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2510066)
      at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
      at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
      at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
      at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
      at ThrowIfEmptySubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
      at ThrowIfEmptySubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
      at TakeLastSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877),
  promise: ZoneAwarePromise [Promise] {
    __zone_symbol__state: 0,
    __zone_symbol__value: Error: Cannot match any routes. URL Segment: 'index.php'
        at router_ApplyRedirects.noMatchError (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553577)
        at catchError_CatchSubscriber.selector (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553228)
        at catchError_CatchSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2510066)
        at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
        at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
        at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
        at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
        at ThrowIfEmptySubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
        at ThrowIfEmptySubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
        at TakeLastSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
  },
  zone: <ref *1> Zone {
    _parent: Zone {
      _parent: null,
      _name: '<root>',
      _properties: {},
      _zoneDelegate: [ZoneDelegate]
    },
    _name: 'angular',
    _properties: { isAngularZone: true },
    _zoneDelegate: <ref *2> ZoneDelegate {
      _taskCounts: [Object],
      zone: [Circular *1],
      _parentDelegate: [ZoneDelegate],
      _forkZS: null,
      _forkDlgt: null,
      _forkCurrZone: null,
      _interceptZS: null,
      _interceptDlgt: null,
      _interceptCurrZone: null,
      _invokeZS: [Object],
      _invokeDlgt: [ZoneDelegate],
      _invokeCurrZone: [Circular *1],
      _handleErrorZS: [Object],
      _handleErrorDlgt: [ZoneDelegate],
      _handleErrorCurrZone: [Circular *1],
      _scheduleTaskZS: [Object],
      _scheduleTaskDlgt: [ZoneDelegate],
      _scheduleTaskCurrZone: [Circular *1],
      _invokeTaskZS: [Object],
      _invokeTaskDlgt: [ZoneDelegate],
      _invokeTaskCurrZone: [Circular *1],
      _cancelTaskZS: [Object],
      _cancelTaskDlgt: [ZoneDelegate],
      _cancelTaskCurrZone: [Circular *1],
      _hasTaskZS: [Object],
      _hasTaskDlgt: [ZoneDelegate],
      _hasTaskDlgtOwner: [Circular *2],
      _hasTaskCurrZone: [Circular *1]
    }
  },
  task: ZoneTask {
    _zone: <ref *1> Zone {
      _parent: [Zone],
      _name: 'angular',
      _properties: [Object],
      _zoneDelegate: [ZoneDelegate]
    },
    runCount: 0,
    _zoneDelegates: null,
    _state: 'notScheduled',
    type: 'microTask',
    source: 'Promise.then',
    data: ZoneAwarePromise [Promise] {
      __zone_symbol__state: 0,
      __zone_symbol__value: Error: Cannot match any routes. URL Segment: 'index.php'
          at router_ApplyRedirects.noMatchError (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553577)
          at catchError_CatchSubscriber.selector (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2553228)
          at catchError_CatchSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:2510066)
          at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
          at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
          at MapSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
          at MapSubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
          at ThrowIfEmptySubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
          at ThrowIfEmptySubscriber.error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532662)
          at TakeLastSubscriber._error (/home/projectname/public_html/test/dist/ProjectName/server/main.js:1:532877)
    },
    scheduleFn: undefined,
    cancelFn: undefined,
    callback: [Function (anonymous)],
    invoke: [Function (anonymous)]
  }
}

CodePudding user response:

I am facing same issue when i hosting our application in cpanel. some inner url not work properly so i just copy the inner url to main route file and it work property.

  • Related