Giter VIP home page Giter VIP logo

dotnet-angular-cli-ssr-debug-test's Introduction

Purpose

This repository is a simplified repro to test server-side debugging capibilities using the latest ASP.NET Core Angular-Cli-based templates. Currently, there appears to be an issue with .map files not being generated for the server-side bundles, and this results in a server-side debug experience where you can only debug the minified javascript code, rather than the source typescript files.

The issue is tracked in #8931 in the CLI repo and #1449 in the JavaScriptServices repo.

Repro Steps

Prerequisites: npm and the dotnet core cli

  1. Clone this repo locally, or follow the "How this repo was built" instructions below to start from scratch.
  2. From the ClientApp directory, run npm install.
  3. Set environment to development: set ASPNET_ENVIRONMENT=Development (Windows) export ASPNET_ENVIRONMENT=Development (Mac/Linux)
  4. From the root project directory run dotnet run.
  5. Navigate a browser window to http://localhost:5000
  6. Look for ouput in the command line that looks like this:
warn: Microsoft.AspNetCore.NodeServices[0]
      Debugger listening on ws://127.0.0.1:9229/652cb200-9bc5-4de6-bbe8-dbcc3ff3be00
  1. Open a chrome tab to this URL (replacing the GUID in this string with the GUID in the command line in step #6):
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:9229/652cb200-9bc5-4de6-bbe8-dbcc3ff3be00

Result

In the chrome debugger, you will only see the minified .js files, rather than the full (more useful) source files: chrome debugger

How this repo was built

  1. Install the latest Angular-Cli-based templates:
dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0-rc1-final
  1. Create a new directory, navigate to it, and run:
dotnet new angular
  1. Modify the project according to the instructions in the template documentation under "Server-Side Rendering".
  2. Enable server-side debugging by adding these lines to ConfigureServices method in Startup.cs (from instructions here):
services.AddNodeServices(options => {
    options.LaunchWithDebugging = true;
    options.DebuggingPort = 9229;
});

dotnet-angular-cli-ssr-debug-test's People

Contributors

astegmaier avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.