I’m converting an old (huge) Ionic 2 project (back when awesome-typescript-loader was used for compilation, I believe) to the new beta.11, and before, it ignored all the errors and everything worked just fine.
TL;DR: How can we force Ionic Serve to build the resulting js file even if there are js errors in the code?
I’m really hoping for some input here since I’m really stuck!
Maybe not what you want to hear, but I think it’s good that the compiler doesn’t produce any results if the compilation failed.
Per definition it’s the way compilators works to ensure that the results/compilated code works all together. Otherwise you will always have to check manually your logs to ensure that you didn’t forgot any errors.
With these remarks done, what is your errors? Could you post the logs here?
Not sure I could help but could have a look and try.
I hear what you are saying but I think this should really be up to the developer. And like I said, the typescript compiler even ignores these errors by default. I tried compiling a clean Angular 2 project with errors in it, and it compiled despite of them. Why would Ionic behave any differently?
The errors are basic ones (and do in no way actually make compilation impossible) and easy to fix, but there are tons of them. For example, sometimes, objects are added to "this"at runtime so the compiler doesn’t know about them. It throws an error like this:
Property 'i18n' does not exist on type 'VerifyAccount'. I know of course that I can define them, but it should compile despite these errors. It did before.
I really hope that there is a way around this
I guess we both have our point of view, maybe coming from different past coding languages experiences.
Anyway, won’t argue that much more, just wanted to say that I just ran a refactoring where I changed some of my model types (like from array of string to string and vice versa) and I’m actually pretty happy I couldn’t start my app till I had fix everything…just for the record
I’ve managed to get it to build (thanks to some help from the ionic team) despite the errors, and I managed to get the project up and running again.
Also, I would say that the client/employer situation, time criticality of the project and budgeting concerns play a lot larger role in this than “past coding languages experiences”, but thanks for the condescending addition to the record
You can always do:
I don’t recommend doing this normally, but it’s a viable solution when you don’t have any typings.
Why can’t you fix the program so that it compiles without error instead?
OK. I’ll try to make sure never to respond to any of your posts again.