"Not assignable to parameter type NgModuleMetadataType" error for @NgModule when typescript compiler is disabled

I'm seeing this error about NgModuleMetadataType when I have the typescript compiler disabled in webstorm. I'm using the webpack dev server with npm and the built-in compiler was interfering so I disabled it. 

If I enable the typescript compiler but select "use tsconfig.json" everything works fine ( apart from the actual code ). Is there a way to get rid of this warning with the compiler disabled? I've tried enabling and switching to use tsconfig.json then disabling again but with no luck. 

Failing that does Webstorm have a built-in way to run the webpack dev server yet? I feel like I'm missing out by needing to run it in the console, Angular 1.x development was so well supported in Webstorm I'm hoping for something similar before too long

 

3 comments
Comment actions Permalink

1. works fine for me (WS 2016.2.3 and WS 2016.3 EAP, Angular 2 RC6):

what declaration is opened when you ctrl+click on @NgModule? Also, what WebStorm version do you use?

 

2. you run WebPack via NPM script (like `npm server`, etc.), right? You can use NPM toolwindow then - right-click your package.json and choose `Show NPM Scripts`, then click on script name to start it. Or, right-click and choose `Edit <script name> settings` to create Npm run configuration for this script

0
Comment actions Permalink

Thanks Elena, 

It turns out I was on 2016.1.2, upgrading to 2016.2.3 fixed the issue immediately. Sorry to have wasted your time I should have checked for an update first. 

 

I appreciate the tip about the npm runner as well, does it mean I can turn safe write back on? I had disabled it to make webpack reload the site when using Webstorm to edit files. 

0
Comment actions Permalink

If you have webpack watching your code, then you still need disabling this option. As webpack doesn't understand this way of saving files, it won't reload your site regardless of the way you start it

0

Please sign in to leave a comment.