Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Angular2 doesn't seem to be working client side when publishing with VS Code #338

Closed

Description

@levarcooper

I'm running the ANGULAR2SPA app in VS Code and everything seems to be working fine with the exception of the following:

  • Increment button is not working/ (click)="function()" is completely removed on page load
  • Pages are reloading when switching between views

When I run the application from VS 2015 Professional, everything works perfectly. I disabled javascript in my browser and it works exactly as it did with "dotnet run" and VS Code. I checked the browser to make sure vendor.js was loaded. Is there anything in VS Code that would prevent would prevent javascript from running? Obviously I'm just working from VS 2015 but I use VS Code when working on a Mac so I wanted to know if anyone else experienced similar issues.

Activity

  1. MarkPieszak commented on Sep 28, 2016

    @MarkPieszak
    Contributor

    I'm not sure what browser you are using, but it sounds like you have JavaScript Disabled.
    Otherwise, VSCode might not be compiling the webpack files & such properly, it could be something in your Launch.json?

    In Chrome go into settings and make sure this is Unchecked:

    image

  2. levarcooper commented on Sep 28, 2016

    @levarcooper
    Author

    Thanks for the quick reply, Mark. That's what I thought initially and that's why I tried disabling/enabling. I experienced this issue on both my Mac and PC when I cloned the repository. "dotnet run" from the command prompt/terminal gave me the same result. On the PC, I ran the same files in the same browser from Visual Studio 2015 with no problems. Not sure what could be the issue.

  3. SteveSandersonMS commented on Sep 28, 2016

    @SteveSandersonMS
    Member

    In most cases, VS Code is just a text editor and doesn't influence how your application runs. If you've set up some custom launch.json then that might affect it, so if so, try removing that and just running directly from the command line.

    If that's not it, I'd need more information (ideally, repro steps) otherwise I'm not sure how it would be possible to proceed with diagnosing this. Sorry!

  4. MarkPieszak commented on Sep 28, 2016

    @MarkPieszak
    Contributor

    @levarcooper So potentially you might need to run webpack first (in command line), to build all the files, then do dotnet run I've had that happen to me before with projects & VSCode.
    Are you running the base Repo here?

  5. MrCrimp commented on Sep 28, 2016

    @MrCrimp

    For me it was due to the environment variable not being set to 'Development' and webpack-dev-server fails to serve the in-memory script files.

    Set environment explicitly to Development
    For osx in terminal run: ASPNETCORE_ENVIRONMENT=Development dotnet run

    For VsCode try launching as sudo/administrator.

    More info and options here #302

  6. MarkPieszak commented on Sep 28, 2016

    @MarkPieszak
    Contributor

    I also think recent updates Steve made look they might make the default ENV Development, so things like this don't happen.

  7. levarcooper commented on Sep 28, 2016

    @levarcooper
    Author

    @MarkPieszak That was the problem. I ran webpack and everything worked perfectly. Of course, I did everything but that which actually makes sense hindsight. Thank you both for your help with this.

  8. changed the title [-]Angular2 doesn't seem to be working client side[/-] [+]Angular2 doesn't seem to be working client side when publishing with VS Code[/+] on Sep 29, 2016
  9. johnazre commented on Sep 30, 2016

    @johnazre

    I downloaded it yesterday and I was having issues with that until I set the environment to development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions