Skip to content

Commit

Permalink
fix: it should work with no module too
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Jan 16, 2025
1 parent 1f771d6 commit 1215830
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/svelte2tsx/src/svelte2tsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function svelte2tsx(
isTsFile,
svelte5Plus,
isRunes,
moduleAst.renderName
moduleAst?.renderName ?? 'render'
);
let generics = new Generics(str, 0, { attributes: [] } as any);
let uses$$SlotsInterface = false;
Expand All @@ -123,7 +123,7 @@ export function svelte2tsx(
basename,
svelte5Plus,
isRunes,
moduleAst.renderName
moduleAst?.renderName ?? 'render'
);
uses$$props = uses$$props || res.uses$$props;
uses$$restProps = uses$$restProps || res.uses$$restProps;
Expand Down Expand Up @@ -153,7 +153,7 @@ export function svelte2tsx(
svelte5Plus,
isTsFile,
mode: options.mode,
renderName: moduleAst.renderName
renderName: moduleAst?.renderName ?? 'render'
});

// we need to process the module script after the instance script has moved otherwise we get warnings about moving edited items
Expand Down Expand Up @@ -212,7 +212,7 @@ export function svelte2tsx(
generics,
isSvelte5: svelte5Plus,
noSvelteComponentTyped: options.noSvelteComponentTyped,
renderName: moduleAst.renderName
renderName: moduleAst?.renderName ?? 'render'
});

if (options.mode === 'dts') {
Expand Down

0 comments on commit 1215830

Please sign in to comment.