aspnetcore-vuetify-universal
aspnetcore-vuetify-universal copied to clipboard
Cannot run the repo prerendering issues
Hi dude,
I am keen to see what you have done but I cannot run the application VS2017 because of the pre-rendering. Could you please tell me how I can fix it:
Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: window is not defined
Thanks for your help
Hi, I'm sorry that I just written a readme in Chinese. Now I telling the way to run this project right here:
- install node.js
- run
npm install
- run
dotnet run
You should ensure has been installed all the node packages.If there are any questions,please feel free to comment below.Thanks for your attention.
@ElderJames thanks for that I have done all those things I also had to install uglifyjs-webpack-plugin but the error is to do with pre-rendering. I don't mind running the project without pre-rendering but I don't know how to do this?
Oh,I'm sorry,this project has been refactored only applies to the server-side prerending... But you also refer to anthor project iview-aspnetcore to learn how to integrate a single page app to asp.net core.
There is a tip: Just write a middleware which make all the routes fallback to the entrance index.html file. Like:
app.Use(async (context, next) =>
{
await next();
if (context.Response.StatusCode >= 400)
{
context.Response.StatusCode = 200;
await context.Response.SendFileAsync("wwwroot/index.html");
}
});
If you have any problems,please tell me! :)