-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent js assets from being added into the public assets when targeting server #363
Comments
Yeah, I just realised I leaked some API keys this way. I think I'm tapping out. Using vinxi/solidstart is a mess and they are not very responsive. I had hoped that having solid start and tanstack start as users of vinxi would create a better ecosystem, but alas ti hasn't happened. I am grateful for all the awesome work people are pouring into these amazing technologies, but at this point in time they're not safe for production. |
The shared JS assets being leaked into the public folder are not currently a security concern for TanStack Start, since what's being leaked is our handler implementation and our util for easily returning @nksaraf had solid reasoning for why the "assets" were being sent into the I'd try implementing a "fix" myself, but I'm just too unfamiliar with this codebase to make any changes with confidence 😅 |
I may have found the issue in one file in which I dynamically import another file, so that might be the cause of it, but still, the issue is that it was leaked in the public folder when it shouldn't, especially since it's duplicated in server and public. Duplication is also another issue, since most JS files are duplicated, like file.js, file2.js, file3.js, file32.js (!) for some reason. |
From TanStack Start discussion thread: https://discord.com/channels/719702312431386674/1280228822104674334
Currently, routers with
target: "server"
andtype: "http"
, have ALL their"assets"
output into the"public"
directory.Builds with shared assets therefore cause outputs in the public folder resembling a structure similar to this. In this example, the router name is
"api"
with its base set to"/api"
.See full TanStack Start build-output: https://github.com/SeanCassiere/vigilant-journey/tree/master/.vercel/output/static
Unless "non-built js" assets are found, the
"public/api/"
directory could probably be omitted duringbuild
. Therefore, just outputting:From @nksaraf
The text was updated successfully, but these errors were encountered: