NavParams references deleted but still causing errors after migrating to Ionic 4


I’m getting the following error after migrating my code to Ionic 5 with Router. I was using NavParams to pass parameters between the different pages of the app but now I’m using Router and the Storage class. Here’s the error:

NullInjectorError: No provider for NavParams!

I don’t understand why this error appears because there is nothing about NavParams in my .ts files. If I include NavParams in the provider list on app.module.ts, I get a different error:

Error: Can't resolve all parameters for NavParams

The app is generated and deployed on the device I use, but only a blank screen is displayed.
Any clues about what’s going on and how to solve it? My Ionic version is 5.4.4.
Thanks in advance!

My friend, in your code has NavParams declared! Check the code! Use FIND in your IDE!


Incidentally, Storage is a bad tool for in-app communication. Use a mutually injected service provider instead.

@starlley I found the references in the node_modules and www directories. I deleted and regenerated them and the problems are solved. Thanks!
@rapropos Good point, thank you!

I’m still migrating the app to Ionic 4 and now I’m stuck with CORS issues (using Angular HttpClient). I changed the headers sent by the server as pointed by WebView 3.x but on an iOS device ionic://localhost doesn’t work and gives the origin not allowed error anyway… I guess I’m missing something, but I don’t know exactly what.