This error occurs when the Renderings defined in Sitecore and the components defined in the JSS app do not match.
Rishi - You said you deployed using
jss deploy files - this command deploys the JS bundle, but does not create any Sitecore items.
When switching from Code-First to Sitecore-First, it is recommended to use
jss deploy app to ensure that files, and Sitecore items (template, rendering definitions) get imported. If you need to import content too, then use
jss deploy app -c
When the import runs, pay attention to the output in the terminal. Make sure there are no errors.
If the above steps were followed and you are still seeing this error, check the following:
src/boot/componentFactory.js for exported JS component names)
- After a deploy, check the timestamp of the JS bundle in
<SitecoreRoot>/dist/appName to verify that it's actually getting deployed. If it's not, verify that the values in your scjssconfig.js and your JSS XML configs (Sitecore path, API path, deployment secret etc) are as expected.