<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.31</li>
<li>Operating System: All</li>
<li>Browser: All</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Config file</strong></p>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test as base } from '@playwright/test';

export const test = base.extend&lt;{ foo: never }&gt;({
  foo: [
    async ({}, use) =&gt; {
      // Some stuff here

      await use(); // TS error: Expected 1 arguments, but got 0.

      // Other stuff here
    },
    { auto: true }
  ],
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-k">as</span> <span class="pl-s1">base</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-c1">extend</span><span class="pl-c1">&lt;</span><span class="pl-kos">{</span> <span class="pl-c1">foo</span>: <span class="pl-s1">never</span> <span class="pl-kos">}</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">foo</span>: <span class="pl-kos">[</span>
    <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
      <span class="pl-c">// Some stuff here</span>

      <span class="pl-k">await</span> <span class="pl-s1">use</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// TS error: Expected 1 arguments, but got 0.</span>

      <span class="pl-c">// Other stuff here</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span> <span class="pl-c1">auto</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Allowing <code class="notranslate">use</code> to be called without arguments, as demonstrated in the docs under <a href="https://playwright.dev/docs/test-fixtures#automatic-fixtures" rel="nofollow">Automatic Fixtures</a>.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto"><code class="notranslate">Expected 1 arguments, but got 0.</code></p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.31.2]</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">I am having trouble with TS errors when trying to use parameterized projects following the the <a href="https://playwright.dev/docs/test-parameterize#parameterized-projects" rel="nofollow">official documentation</a></p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import type { defineConfig } from '@playwright/test';
import { TestOptions } from './my-test';

export default defineConfig({
    projects: [
        {
            name: 'alice',
            use: { person: 'Alice' },
        }
    ]
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">type</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">TestOptions</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./my-test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">'alice'</span><span class="pl-kos">,</span>
            <span class="pl-c1">use</span>: <span class="pl-kos">{</span> <span class="pl-c1">person</span>: <span class="pl-s">'Alice'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// my-test.ts
import { test as base } from '@playwright/test';

export type TestOptions = {
  person: string;
};

export const test = base.extend&lt;TestOptions&gt;({
  // Define an option and provide a default value.
  // We can later override it in the config.
  person: ['John', { option: true }],
});"><pre class="notranslate"><span class="pl-c">// my-test.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-k">as</span> <span class="pl-s1">base</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-s1">type</span> <span class="pl-v">TestOptions</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">person</span>: <span class="pl-s1">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-s1">base</span><span class="pl-kos">.</span><span class="pl-c1">extend</span><span class="pl-c1">&lt;</span><span class="pl-v">TestOptions</span><span class="pl-c1">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c">// Define an option and provide a default value.</span>
  <span class="pl-c">// We can later override it in the config.</span>
  <span class="pl-c1">person</span>: <span class="pl-kos">[</span><span class="pl-s">'John'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">option</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// example.spec.ts
import { test } from './my-test';

test('test 1', async ({ person }) =&gt; {
console.log(person)
});"><pre class="notranslate"><span class="pl-c">// example.spec.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'./my-test'</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'test 1'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> person <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">person</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ol dir="auto">
<li>
<p dir="auto">Open <code class="notranslate">playwright.config.ts</code>  and  notice the TypeScript error on <code class="notranslate">defineConfig</code> :<br>
<code class="notranslate">TS1361: 'defineConfig' cannot be used as a value because it was imported using 'import type'.</code></p>
</li>
<li>
<p dir="auto">Run the test and notice the following error:<br>
<code class="notranslate">ReferenceError: defineConfig is not defined</code></p>
</li>
<li>
<p dir="auto">Looking at other examples of Playwright documentation, it seems like that using the keyword <code class="notranslate">type</code> in the imports in <code class="notranslate">playwright.config.ts</code> is not necessary, so I remove that.</p>
</li>
<li>
<p dir="auto">Now there is another TS error in <code class="notranslate">playwright.config.ts</code> on <code class="notranslate">person: 'Alice'</code>:</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No overload matches this call.
  Overload 1 of 3, '(config: PlaywrightTestConfig&lt;{}, {}&gt;): PlaywrightTestConfig&lt;{}, {}&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;{}&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
      Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;{}&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
  Overload 2 of 3, '(config: PlaywrightTestConfig&lt;unknown, {}&gt;): PlaywrightTestConfig&lt;unknown, {}&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
      Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
  Overload 3 of 3, '(config: PlaywrightTestConfig&lt;unknown, unknown&gt;): PlaywrightTestConfig&lt;unknown, unknown&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;unknown&gt;&gt;'.
"><pre class="notranslate"><code class="notranslate">No overload matches this call.
  Overload 1 of 3, '(config: PlaywrightTestConfig&lt;{}, {}&gt;): PlaywrightTestConfig&lt;{}, {}&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;{}&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
      Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;{}&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
  Overload 2 of 3, '(config: PlaywrightTestConfig&lt;unknown, {}&gt;): PlaywrightTestConfig&lt;unknown, {}&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
      Object literal may only specify known properties, and 'person' does not exist in type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;{}&gt;&gt;'.
  Overload 3 of 3, '(config: PlaywrightTestConfig&lt;unknown, unknown&gt;): PlaywrightTestConfig&lt;unknown, unknown&gt;', gave the following error.
    Type '{ person: string; }' is not assignable to type 'UseOptions&lt;PlaywrightTestOptions &amp; CustomProperties&lt;unknown&gt;, PlaywrightWorkerOptions &amp; CustomProperties&lt;unknown&gt;&gt;'.

</code></pre></div>
<ol start="5" dir="auto">
<li>Try running the test again and notice that the parameterization is working, despite error in step 4.</li>
</ol>