Angular project keeps showing old component html template in browser after replacing it

581 Views Asked by At

I am currently developing Angular libraries for reuse across different angular projects in our software department. One library is a login form. I published it to npm and installed and imported it in another angular project so I can replace the old login form with the new one.

Problem is: Although there is nowhere any reference at all to the old login-form component, I still keep seeing the old login form in the browser. The typescript file of the login form however seems to be replaced/updated as expected (E.g. validation messages are different now). It's like the frontend of the old login form is cached somewhere and I can't get rid of it. I already tried installing a new browser as well as deleting the cache of the browser and of Angular with "ng cache clean". It's becoming so weird that if I search for innertext (e.g. "Load Models") from the old login form in my VS Code, I get no results (as expected because I got rid of the login-form template). But I still keep seeing it in the browser!

Is there anything I might be missing?

Old login form - what I am seeing New login form - what I should be seeing

1

There are 1 best solutions below

0
Fabian Röhrle On

[Solved] Seems like NPM has its own cache as well. Deleting "node_modules" and "package.json" and then running "npm install" solved my issue.