@ngtools/webpack 1.7.3.TypeError: ts.createModuleResolutionCache is not a function
hello I used angular-cli to build my project
I can build succeed three days ago. But I get wrong today. I saw ngtools/webpack is updated. use angular-cli: 1.0.0-beta.28.3 use ngtools/webpack 1.7.3 I got error 。
ts.createModuleResolutionCache is not a function
TypeError: ts.createModuleResolutionCache is not a function
at AotPlugin._setupOptions (/workspace/angularjs/node_modules/.1.7.3@@ngtools/webpack/src/plugin.js:146:42)
at new AotPlugin (/workspace/angularjs/node_modules/.1.7.3@@ngtools/webpack/src/plugin.js:30:14)
at Object.exports.getNonAotConfig (/workspace/angularjs/node_modules/.1.0.0-beta.28.3@angular-cli/models/webpack-configs/typescript.js:26:13)
at new NgCliWebpackConfig (/workspace/angularjs/node_modules/.1.0.0-beta.28.3@angular-cli/models/webpack-config.js:24:37)
at Class.run (/workspace/angularjs/node_modules/.1.0.0-beta.28.3@angular-cli/tasks/build.js:16:29)
at Class.buildRun (/workspace/angularjs/node_modules/.1.0.0-beta.28.3@angular-cli/commands/build.run.js:12:22)
at Class.run (/workspace/angularjs/node_modules/.1.0.0-beta.28.3@angular-cli/commands/build.js:40:47)
at Class.
I changed the ngtools/webpack to 1.7.1 is right.
The CLI version used is quite outdated. The current stable version is 1.4.6. Note also that the package name changed during the 1.0-beta phase to @angular/cli.
i have a error but donno how fix it, delete so many times "node_modules" and reinstall nothing change always same error.
ERROR in TypeError: Cannot use 'in' operator to search for 'providers' in null
at C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:111:73
at Array.filter (native)
at _extractLazyRoutesFromStaticModule (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:111:29)
at C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:128:10)
at includeLazyRouteAndSubRoutes (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:66:25)
at Array.reduce (native)
at includeLazyRouteAndSubRoutes (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:67:26)
at Array.reduce (native)
at Object.listLazyRoutesOfModule (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_impl.js:54:36)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\cli\node_modules\@ngtools\webpack\src\plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (C:\Users\iii\WebstormProjects\iii\node_modules\@angular\cli\node_modules\@ngtools\webpack\src\plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
@istiti that seems like a different problem. Can you open a new issue and include all details in the issue template please?
done https://github.com/angular/angular-cli/issues/8025
cc @filipesilva
same issue here ..
Can you provide the TypeScript version used with the project?
have to say I'm not too happy about this....
using angular cli 1.0.0-beta.25.5 angular 2.4.3 typescript 2.0.3
and now a breaking change in webpack causes all my builds to fail.
@TylerDev6 can you try updating typescript to 2.1 please?
@filipesilva will do.
@filipesilva did the trick.
Glad to hear it. That's the workaround for now, we're looking at our options to address this.
@filipesilva correction.... moving straight to 2.1.0 fails with
AppModule is not an NgModule
moving to ~2.0.3 fixed it though
For those who have the same issue but running the latest angular cli (1.4.6), just update your typescript version (I installed ~2.5.3, and worked correctly). Maybe after the update you have to make a few changes on your code, because of type errors that the older typescript version did not check or notice about.
step:1 Update your angular CLI using this sudo npm install --save-dev @angular/cli@latest
step:2 In Mac, press Shift+Command+H then select the Home option. Now select package.json,package-lock.json file and delete both the files.
step:3 Restart your terminal and then it will work.
@ngtools/webpack 1.7.4 has been released with a fix that handles the lack of certain functionality in TS versions less than 2.1.5.
@RanjithRana just a quick comment that running npm with sudo is dangerous and should not be necessary. (check out nvm for managing node installations).
This has been fixed in #8028 .
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.