You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
When you run the template ReactReduxSpa with dotnet run it will load up perfectly.
But when you delete the server and the client "dist" folders an typescript error will be shown in configureStore.ts (typescript version 2.3.4) which can be circumvented if you do this:
And if you upgrade the typescript to version 2.4.1 (latest at the moment) there will be another error:
TS2322: Type '(state: WeatherForecastsState, action: KnownAction) => WeatherForecastsState' is not assignable to type 'Reducer<WeatherForecastsState>'.
Types of parameters 'action' and 'action' are incompatible.
Type 'A' is not assignable to type 'KnownAction'.
Type 'Action' is not assignable to type 'KnownAction'.
Type 'Action' is not assignable to type 'RequestWeatherForecastsAction'.
Property 'startDateIndex' is missing in type 'Action'.
Type 'A' is not assignable to type 'ReceiveWeatherForecastsAction'.
Type 'Action' is not assignable to type 'ReceiveWeatherForecastsAction'.
Property 'startDateIndex' is missing in type 'Action'.
(still looking for a workaround on this one)
So.... the template is not working as expected :(
I figured that out, and also there are no change logs available for TypeScript (at least not at this moment).
So I'll close it. and you can reopen it if you plan to upgrade to version 2.4.1 (or above) :)
Just as an FYI, If I try to run the latest deployed generator created React-Redux template under IISExpress, with TypeScript 2.3.1, I get this:
The only times I have been able to run the generated code without errors, with multiple versions of TypeScript, has been dotnet run... is there perhaps something different in the way that IISExpress handles the TypeScript compilation differently?
(I am happy to continue with dotnet run. - it's TypeScript with third party libraries that cause the most problems).
I have literally just tested the same project using VS Code, using the launch settings below.
.NET Core Launch (console) will work.
.NET Core Launch (web) gives the same TypeScript errors.
I am presuming now that the WebPackBased middleware is being used to provide its web server for hot reloading etc. And would not work with IISExpress in the way...?
You can try to set up Code properly to debug with this article
I think there is one on MSDN as well.
I really want to use VS Code as well for this. Much richer for the client side. I'm still searching for a reliable and reproducible setup using React, Redux, TypeScript, and ASP.Net Core. Something has broken too many times at key moments in projects. Always create a template that you manage to get working, and clone that.
Well, I'm still playing with this, and just did a test - which actually confuses me a little more.
I checked the default launch settings in my Visual Studio 2017 project, under Debug:
For IISExpress, they had the ASPNETCORE_ENVIRONMENT variable was preset to Development.
However for running the project directly, is was not set at all, and effectively that defaults to Production.
As soon as I changed the IISExpress settings to Production - all the TypeScript errors disappeared.
When I changed the project to run in Development - hey presto, the UseWebpackDevMiddleware was executed, and node started throwing out the TypeScript errors.
As expected, same in VSCode when the environment is set to Development -TypeScript errors.
Now the reason I a little more confused, is that this is the latest Yeoman edition of the generator released 2 months ago, and it looks as if it could never have worked. I am also surprised I hadn't realised that before ;-)
Maybe the dotnet new version of the command line template is newer?
@mcquiggd Try upgrading to TypeScript 2.3.4 (since it is the most stable one (so far), and I am sure it works). Secondly this template is using .net core preview 2 (which is still not stable enough and at least if you plan to test with it (play with it) install the insider build of Visual Studio 2017 (which currently is 15.3).
Regarding the Environment variable, I have been experience also problems, even though I have set it manually as a permanent user variable, but it runs sometimes in production. If I set it from terminal before I use "dotnet run" the it is ok.
Regarding Yeoman, I don't understand why you mentioned it?
Thanks, I will try upgrading to TypeScript 2.3.4... I have to catch up on some lost time today, but will take a look tomorrow.
Currently using VS 2017 15.2 (Release).
We might be talking about different templates - as there are two ways to use this project (JavaScript Service ) - via yo generator-aspnetcore-spa, and via dotnet new . I am currently using Yeoman, with the generator released two months ago. - it targets netcoreapp1.1. I only use 'release' versions...
The generics error has been fixed in the latest version of redux, so if you upgrade to redux@3.7.2 you are should be OK to use typescript 2.4.1. See: reduxjs/redux#2467
Reacted by David Paul McQuiggin, theCuriousOne, Jurvis Tan, Jack Byers and Jakub Matjanowski
Activity
MarkPieszak commentedon Jul 4, 2017
2.4 had some bigger breaking changes so I wouldn't upgrade any of the templates to that just yet.
theCuriousOne commentedon Jul 4, 2017
I figured that out, and also there are no change logs available for TypeScript (at least not at this moment).
So I'll close it. and you can reopen it if you plan to upgrade to version 2.4.1 (or above) :)
mcquiggd commentedon Jul 8, 2017
Just as an FYI, If I try to run the latest deployed generator created React-Redux template under
IISExpress, withTypeScript 2.3.1, I get this:The only times I have been able to run the generated code without errors, with multiple versions of TypeScript, has been
dotnet run... is there perhaps something different in the way that IISExpress handles the TypeScript compilation differently?(I am happy to continue with
dotnet run.- it's TypeScript with third party libraries that cause the most problems).theCuriousOne commentedon Jul 8, 2017
@mcquiggd How do you run it on iis express? if you are starting it from Visual Studio Code debugger then what are your settings?
mcquiggd commentedon Jul 8, 2017
Well, actually that was from Visual Studio 2017.
I have literally just tested the same project using VS Code, using the launch settings below.
.NET Core Launch (console) will work.
.NET Core Launch (web) gives the same TypeScript errors.
I am presuming now that the WebPackBased middleware is being used to provide its web server for hot reloading etc. And would not work with IISExpress in the way...?
You can try to set up Code properly to debug with this article
I think there is one on MSDN as well.
I really want to use VS Code as well for this. Much richer for the client side. I'm still searching for a reliable and reproducible setup using React, Redux, TypeScript, and ASP.Net Core. Something has broken too many times at key moments in projects. Always create a template that you manage to get working, and clone that.
theCuriousOne commentedon Jul 8, 2017
Currently notinfront of PC (out), but maybe the build commands fromthe *.csproj are not being executed (see inside the csproj file)
mcquiggd commentedon Jul 8, 2017
@theCuriousOne
Well, I'm still playing with this, and just did a test - which actually confuses me a little more.
I checked the default launch settings in my Visual Studio 2017 project, under Debug:
For IISExpress, they had the ASPNETCORE_ENVIRONMENT variable was preset to Development.
However for running the project directly, is was not set at all, and effectively that defaults to Production.
As soon as I changed the IISExpress settings to Production - all the TypeScript errors disappeared.
When I changed the project to run in Development - hey presto, the
UseWebpackDevMiddlewarewas executed, and node started throwing out the TypeScript errors.As expected, same in VSCode when the environment is set to Development -TypeScript errors.
Now the reason I a little more confused, is that this is the latest Yeoman edition of the generator released 2 months ago, and it looks as if it could never have worked. I am also surprised I hadn't realised that before ;-)
Maybe the dotnet new version of the command line template is newer?
Ugh. I just don't have time for this.
mcquiggd commentedon Jul 8, 2017
Oh, and a few minutes ago, a new issue ReactRedux template doesn't compile in strict mode was logged.
Disabling it doesn't fix the issues - the typings are incorrect or missing.
Other people are now logging the same issue.
theCuriousOne commentedon Jul 8, 2017
@mcquiggd Try upgrading to TypeScript 2.3.4 (since it is the most stable one (so far), and I am sure it works). Secondly this template is using .net core preview 2 (which is still not stable enough and at least if you plan to test with it (play with it) install the insider build of Visual Studio 2017 (which currently is 15.3).
Regarding the Environment variable, I have been experience also problems, even though I have set it manually as a permanent user variable, but it runs sometimes in production. If I set it from terminal before I use "dotnet run" the it is ok.
Regarding Yeoman, I don't understand why you mentioned it?
mcquiggd commentedon Jul 9, 2017
@theCuriousOne
Thanks, I will try upgrading to TypeScript 2.3.4... I have to catch up on some lost time today, but will take a look tomorrow.
Currently using VS 2017 15.2 (Release).
We might be talking about different templates - as there are two ways to use this project (JavaScript Service ) - via
yo generator-aspnetcore-spa, and viadotnet new. I am currently using Yeoman, with the generator released two months ago. - it targetsnetcoreapp1.1. I only use 'release' versions...DanHarman commentedon Jul 14, 2017
The generics error has been fixed in the latest version of redux, so if you upgrade to redux@3.7.2 you are should be OK to use typescript 2.4.1. See: reduxjs/redux#2467