Skip to content

Renamed main.tsx -> index.tsx for support in create-solid - #259

Merged
birkskyum merged 1 commit into
solidjs:mainfrom
qsenn35:bugfix/vanilla-tanstack-index-import
Aug 21, 2026
Merged

Renamed main.tsx -> index.tsx for support in create-solid#259
birkskyum merged 1 commit into
solidjs:mainfrom
qsenn35:bugfix/vanilla-tanstack-index-import

Conversation

@qsenn35

@qsenn35 qsenn35 commented May 24, 2026

Copy link
Copy Markdown
Contributor

Bug:

When using npm create solid and choosing Vanilla JS + tanstack options, it results in a index.html that contains a <script> with src="./src/main.tsx" rather than a valid .jsx file.

Reason:

In the solid-cli/create package we have this code in createVanillaJS():

writeFileSync(indexPath, (await readFile(indexPath)).toString().replace("index.tsx", "index.jsx"));

This will not pattern match with tanstack templates due to the name of the import being main.tsx instead of index.tsx resulting in an error when starting the project.

Fix:

Update the names in the Vanilla JS tanstack templates to contain index.tsx instead of main.tsx to allow the pattern matchup (and thus renaming) to work.


From what I can tell, the only thing that really cares about the name of the entry point of tanstack related apps is the index.html and the solid create cli functions. Let me know if there's anywhere that needs changes due to the renaming, as I was not able to find any other places in this repo or others.

@qsenn35

qsenn35 commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

Also the reason I'm making the change here is purely because it seems weird to create an edge case handler in the solid-create package

@brenelz brenelz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@birkskyum
birkskyum merged commit 5210761 into solidjs:main Aug 21, 2026
@qsenn35

qsenn35 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

ay bet, ty for the merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants