Skip to content

Angular 5 error - only happens after "dotnet publish" #482

@mleader1

Description

@mleader1

Hi,

I updated my solution with the latest files/changes from this repo. Everything worked really well locally until I did the "dotnet publish" and uploaded the files to our server.

When running the published files directly by "dotnet XXXXX.dll" it will go error when I hit the web url. The console shows the following error:

---> (Inner Exception #0) Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: Prerendering failed because of error: SyntaxError: Invalid regular expression: /^[_A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-��-󯰀-�:][-._A-Za-z0-9·À-ÖØ-öø-˿̀-ͽͿ-῿‌‍‿⁀⁰-⿯、-퟿豈-﷏ﷰ-��-󯰀-�:]*$/: Range out of order in character class

The trace logs showed that the error happens when calling the server method Prerenderer.RenderToString()

So in summary - the whole project runs and without any problem in local development mode. However the published version doesn't work and reports prerendering failure due to regular expression error (weird).

I simplified the server transferData object but it fell into the same error.... Help please...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions