jump to navigation

“emitted file Xyz.d.ts overwites a previously emitted file of the same name” May 1, 2020

Posted by kevinbe71 in Development, React, TypeScript, Uncategorized, Web Development.
Tags: , , , ,
add a comment

After making some recent changes and then upgrading rollup to 2.7.6 (from a 1.x release) I started seeing 2 of these warnings appear:

(!) The emitted file “actions\Xyz.d.ts” overwrites a previously emitted file of the same name.
(!) The emitted file “actions\Xyz.d.ts” overwrites a previously emitted file of the same name.

I used git bisect to quickly track down the commit that caused this issue and, fortunately, it was pretty obvious then:

I had 2 variations of imports of this file:
import * as Xyz from “./Xyz”;
import * as Xyz from “./xyz”;

This may not jump out to you immediately but the difference is a camelCase name vs a PascalCase name of the same file. The true file was called “xyz” but if you’re using Mac OS X or Windows then the compiler actually permits this. The newer version of rollup wasn’t letting things be… if wasn’t happy (which was a good thing)!

Design a site like this with WordPress.com
Get started