T
TanStack5mo ago
like-gold

server.allowedHosts in vite.config.js error

5 Replies
like-gold
like-goldOP5mo ago
but there is not vite config, it’s just app config which doesn’t support server.allowedHosts
stormy-gold
stormy-gold5mo ago
also had this problem this is what I found on this server: https://discord.com/channels/719702312431386674/1337811059180048477/1338809045578153984
import { defineConfig } from '@tanstack/react-start/config';
import type { InlineConfig } from 'vite';
import tsConfigPaths from 'vite-tsconfig-paths';

const viteConfig: InlineConfig = {
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
],
server: {
allowedHosts: ['example.com'],
},
};

export default defineConfig({
vite: viteConfig,
// https://react.dev/learn/react-compiler
react: {
babel: {
plugins: [
[
'babel-plugin-react-compiler',
{
target: '19',
},
],
],
},
},
tsr: {
// https://github.com/TanStack/router/discussions/2863#discussioncomment-12458714
appDirectory: './src/app',
},
});
import { defineConfig } from '@tanstack/react-start/config';
import type { InlineConfig } from 'vite';
import tsConfigPaths from 'vite-tsconfig-paths';

const viteConfig: InlineConfig = {
plugins: [
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
],
server: {
allowedHosts: ['example.com'],
},
};

export default defineConfig({
vite: viteConfig,
// https://react.dev/learn/react-compiler
react: {
babel: {
plugins: [
[
'babel-plugin-react-compiler',
{
target: '19',
},
],
],
},
},
tsr: {
// https://github.com/TanStack/router/discussions/2863#discussioncomment-12458714
appDirectory: './src/app',
},
});
like-gold
like-goldOP5mo ago
thanks! and are you familiar with this?
No description
stormy-gold
stormy-gold5mo ago
hmm, sorry I have no clue about that
like-gold
like-goldOP5mo ago
fixed it by using build, thanks

Did you find this page helpful?