T
TanStack7mo ago
rival-black

Trying to identify source of error: TypeError: globalThis.app.config is undefined

I'm copying the ThemeToggle functionality from tanstack.com. I used the newly launched https://github.com/TanStack/create-tsrouter-app CLI, copied over the ThemeToggle component from https://github.com/TanStack/tanstack.com/blob/main/app/components/ThemeToggle.tsx and resolved any dependencies issue. The error is being thrown by https://github.com/mauricioschneider/mau.xyz/blob/main/app/components/public/ThemeToggle.tsx#L20. This happens when I click my toggle. I'm running vite. Was trying to use vinxi, in case it was something related to that, but haven't tried yet.
I couldn't find anything in Google by searching globalThis.app.config Does anyone have any clues on what I should look at next? Thanks!
9 Replies
fair-rose
fair-rose7mo ago
start does not work without vinxi yet it will soon
rival-black
rival-blackOP7mo ago
With vinxi I get Loading module from “http://localhost:3000/app/main.tsx” was blocked because of a disallowed MIME type (“application/octet-stream”).. I gues I need to export a RootComponent or something like that instead of relying on index.html? Getting confirmation that it's a vite vs vinxi thing leads me on the right path. I'll see what else I need to change from the template to match the tanstack.com setup
fair-rose
fair-rose7mo ago
not sure how create-tsrouter-app exposes start ? does it?
rival-black
rival-blackOP7mo ago
I don't think it uses start by default. I had to add it it's just router
fair-rose
fair-rose7mo ago
yeah that's the problem then base it off a true start template npx create @tanstack/start or degit one of the start examples in our repo
rival-black
rival-blackOP7mo ago
I'll do that. I initially thought create-tsrouter-app used start
fair-rose
fair-rose7mo ago
create-tsrouter-app will provide start once we hit stable not yet
rival-black
rival-blackOP7mo ago
makes sense thanks, Manuel! migrated everything and the toggle works :D. And I'm learning how routes work in start as bonus
fair-rose
fair-rose7mo ago
nice!

Did you find this page helpful?