genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[JS] 'Import attributes cannot be used with a type-only import' when formatting TypeScript

Open yesudeep opened this issue 10 months ago • 3 comments

./js/plugins/mcp/src/client/message.ts:17:73 syntax/correctness/noTypeOnlyImportAttributes ━━━━━━━━━━

  ✖ Import attributes cannot be used with a type-only import.
  
    15 │  */
    16 │ 
  > 17 │ import type { PromptMessage } from '@modelcontextprotocol/sdk/types.js' with {
       │                                                                         ^^^^^^
  > 18 │   'resolution-mode': 'import',
  > 19 │ };
       │ ^
    20 │ import { MessageData, Part } from 'genkit';
    21 │ 
  
  ℹ The type-only import is defined here.
  
    15 │  */
    16 │ 
  > 17 │ import type { PromptMessage } from '@modelcontextprotocol/sdk/types.js' with {
       │        ^^^^
    18 │   'resolution-mode': 'import',
    19 │ };

yesudeep avatar Feb 14 '25 16:02 yesudeep

Hi! I'm having the same. How do you fix this @yesudeep? Is there a workaround?

stephane-segning avatar May 29 '25 16:05 stephane-segning

@stephane-segning does this block you from building code that uses Genkit?

cc: @pavelgj

yesudeep avatar May 30 '25 01:05 yesudeep

No it was fine, I just skip the file concerned. But it's a pain because hte code is not cute

stephane-segning avatar May 30 '25 07:05 stephane-segning