Skip to content

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

Open
qsenn35 wants to merge 1 commit into
solidjs:mainfrom
qsenn35:bugfix/vanilla-tanstack-index-import
Open

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

Conversation

@qsenn35

@qsenn35 qsenn35 commented May 24, 2026

Copy link
Copy Markdown

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
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

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.

1 participant