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.
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
dotnet new angular
`
Open VS 2017 and the project that was created.
Run the application via F5 and the following exception gets generated against startup.cs on the webpack middleware
Exception: Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'.
Error was: C:\Users\jamie\Documents\SourceCode\spike-angular-on-core\node_modules\webpack\lib\webpack.js:7
const Compiler = require("./Compiler");
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (C:\Users\jamie\Documents\SourceCode\spike-angular-on-core\node_modules\aspnet-webpack\WebpackDevMiddleware.js:4:15)
From what I can understand of the problem node_modules\webpack\lib\webpack.js is using ES6 definitions while the Typescript behind node_modules\aspnet-webpack\WebpackDevMiddleware.js is using ES2015. How does a developer resolve this?
Environment
Windows 10 Pro 15063.13
VS 2017 Pro.
`
dotnet --version
1.0.2
node --version
v0.12.2
npm --version
2.7.4
`
The text was updated successfully, but these errors were encountered:
@SteveSanderson thanks, looks like the windows path variable was not correctly updated in the node 6 or 7 x64 installation. Nodejs discussion.
After updating the path to the correct location node -v v6.10.2
The solution then works as expected. Thanks.
Following the basic steps for VS 2017 + .net core + SPA + angular 2 in .net core + SPA + Angular 2
CLI
`
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
dotnet new angular
`
Open VS 2017 and the project that was created.
Run the application via F5 and the following exception gets generated against startup.cs on the webpack middleware
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true });
Exception
From what I can understand of the problem node_modules\webpack\lib\webpack.js is using ES6 definitions while the Typescript behind node_modules\aspnet-webpack\WebpackDevMiddleware.js is using ES2015. How does a developer resolve this?
Environment
Windows 10 Pro 15063.13
VS 2017 Pro.
`
dotnet --version
1.0.2
node --version
v0.12.2
npm --version
2.7.4
`
The text was updated successfully, but these errors were encountered: