how to fix this error :-A canonical issue arises when 301 redirects are not properly in place. This means that your website can be accessed by search engines from several different URLs. This means that search engines can then potentially index your site under different URLs, meaning that it will look like a site of duplicated content
RewriteEngine On
#RewriteBase /
RewriteCond %{HTTP_HOST} ^108\.170\.28\.35
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^http://www.example.com/$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301][L,R=301] [L,R=301]
Check out for more information visit our link
You can set canonical link for page or post to search engines determine that's a main url. If you use wordpress, I recommend you Yoast Seo or Rankmath plugin, they will set canonical url for you automatically. In other hand, you have to do it yourself by coding.
I know with this one and it quite hurts when you pun in so much work on the articles but the google shows this canonical error!
I say you just never change the URL Permalink, just do a simple 301 redirect with any simple WordPress plugin and make sure that your page is actually redirecting to the right page.
And then submit the URL in the search console and it would be solved in few days or in a week.
You can also put a canonical tag and that can also work fine as well.
Hope it helps :)