Angular 2 in debug mode not working with InputOutputStream #1603

Closed
opened 2025-08-09 17:20:51 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @laskoviymishka on 5/24/2016

Steps to reproduce

  1. Open solution
  2. Select Angular2Spa from templates as startup project
  3. Change HostingModel by adding following code in ConfigureServices method:
            services.AddNodeServices(new NodeServicesOptions
            {
                HostingModel = NodeHostingModel.InputOutputStream
            });
  1. Open any page
  2. See exception
JsonReaderException: Unexpected character encountered while parsing value: A. Path '', line 0, position 0.

The issue

Page not load, and exception accured

JsonReaderException: Unexpected character encountered while parsing value: A. Path '', line 0, position 0.

Further technical details

This is pretty easy issue - right now InputOutputStreamNodeInstance wait for first recieved data from Node, and claim it as boot function response. With ng2 it not so, since in development mode it everytime produce message: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
To fix this issue we need implement some kind of filtering our result. Root couse placed inside OnOutputDataReceived method in InputOutputStreamNodeInstance class.

*Originally created by @laskoviymishka on 5/24/2016* ### Steps to reproduce 1. Open solution 2. Select Angular2Spa from templates as startup project 3. Change `HostingModel` by adding following code in `ConfigureServices` method: ``` services.AddNodeServices(new NodeServicesOptions { HostingModel = NodeHostingModel.InputOutputStream }); ``` 1. Open any page 2. See exception ``` JsonReaderException: Unexpected character encountered while parsing value: A. Path '', line 0, position 0. ``` ### The issue Page not load, and exception accured ``` JsonReaderException: Unexpected character encountered while parsing value: A. Path '', line 0, position 0. ``` ### Further technical details This is pretty easy issue - right now `InputOutputStreamNodeInstance` wait for first recieved data from Node, and claim it as boot function response. With ng2 it not so, since in development mode it everytime produce message: `Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.` To fix this issue we need implement some kind of filtering our result. Root couse placed inside `OnOutputDataReceived` method in `InputOutputStreamNodeInstance` class.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1603
No description provided.