<p dir="auto">Geometries having Face4's with MeshFaceMaterial assigned will throw a "map error" after merging vertices with Geometry.mergeVertices.</p>
<p dir="auto">Reason is obvious: mergeVertices triangulates the Face4 to two Face3's but doesn't copy over Face4.materialIndex.</p>
<p dir="auto">So after mergeVertices the geometry contains Face3's without Face3.materialIndex set.<br>
Then of course MeshFaceMaterial can't find its material.</p>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">TypeScript projects that import the typings from <code class="notranslate">examples/jsm/modifiers/CurveModifier.d.ts</code>, or <code class="notranslate">TessellateModifier.d.ts</code> fail to compile due to some type errors.</p>
<p dir="auto"><strong>In <code class="notranslate">CurveModifier.d.ts</code></strong><br>
<code class="notranslate">Material</code> is imported several times at the start resulting in duplicate identifiers:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Geometry, Material, Mesh } from '../../../build/three.module';
import {
	DataTexture,
	Curve,
	Uniform,
	Material,
	InstancedMesh
} from '../../../src/Three';"><pre class="notranslate"><code class="notranslate">import { Geometry, Material, Mesh } from '../../../build/three.module';
import {
	DataTexture,
	Curve,
	Uniform,
	Material,
	InstancedMesh
} from '../../../src/Three';
</code></pre></div>
<p dir="auto">I believe the solution to this is to remove that first import line, moving <code class="notranslate">Geomery</code> and <code class="notranslate">Mesh</code> into the import line below it.</p>
<p dir="auto">This line looks to refer to the accompanying <code class="notranslate">js</code> file, and introduces a duplicate identifier:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { Flow } from './CurveModifier';"><pre class="notranslate"><code class="notranslate">import { Flow } from './CurveModifier';
</code></pre></div>
<p dir="auto">I believe the solution is to remove the line.</p>
<p dir="auto">The use of <code class="notranslate">Curve</code> in this file is missing a type argument. I'm not sure what <code class="notranslate">Flow</code> does so I'm not sure what value that argument should be, but perhaps it should be <code class="notranslate">THREE.Vector3</code>?</p>
<p dir="auto"><strong>In TessellateModifier.d.ts</strong></p>
<p dir="auto">There are some initializers despite this being an ambient context:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="maxEdgeLength: number = 0.1;
maxIterations: number = 6;
maxFaces: number = Infinity;"><pre class="notranslate"><code class="notranslate">maxEdgeLength: number = 0.1;
maxIterations: number = 6;
maxFaces: number = Infinity;
</code></pre></div>
<p dir="auto">I believe these should not provide values.</p>
<p dir="auto">Let me know if I've messed something up in my TypeScript settings though <g-emoji class="g-emoji" alias="joy" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f602.png">😂</g-emoji> . I can probably provide a PR with these fixes if it's helpful!</p>