Puerto Rico Tax

My employer gave me a 499-R/W-2PR and a US W-2 for the same taxable income earned in Puerto Rico as a non-resident. 

How do I file my 1040 so that the IRS does not double tax the wages on both forms since reported twice.  OR is the 499-R and US W-2 incorrect? 

I understand I first file a PR tax return and then on the US return I file for a foreign tax credit for taxes paid to Puerto Rico.   But last time this happened the IRS sent me a notice that doubled my income and came looking for more US taxes.  Thank you  @DanielV01