T
TanStack4w ago
foreign-sapphire

Build failing because of parsing error

Hey guys! I am integrating Lingui with TanStack Start (React + Vite), and I am running into a build error because, for some reason, the Tanstack Start plugin tries to parse the .po translation files, which I am dynamically importing. My Vite config setup:
export default defineConfig({
server: {
port: 3000,
},
plugins: [
lingui(),
tanstackStart({
customViteReactPlugin: true,
target: 'vercel',
}),
tsConfigPaths(),
react({
babel: {
plugins: ['@lingui/babel-plugin-lingui-macro'],
},
}),
tailwindcss(),
],
})
export default defineConfig({
server: {
port: 3000,
},
plugins: [
lingui(),
tanstackStart({
customViteReactPlugin: true,
target: 'vercel',
}),
tsConfigPaths(),
react({
babel: {
plugins: ['@lingui/babel-plugin-lingui-macro'],
},
}),
tailwindcss(),
],
})
The error when running a build:
vite v6.3.5 building for production...
Generated route tree in 64ms
✓ 12 modules transformed.
✗ Build failed in 165ms
error during build:
[vite-plugin-tanstack-start-create-server-fn] Missing semicolon. (1:5)
file: /Users/jawadsefiani/Projects/halal-foodie-next/apps/web/src/locales/fr/messages.po:1:5
at constructor (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:367:19)
at TypeScriptParserMixin.raise (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:6627:19)
at TypeScriptParserMixin.semicolon (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:6923:10)
at TypeScriptParserMixin.parseExpressionStatement (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:13285:10)
at TypeScriptParserMixin.parseExpressionStatement (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:9611:26)
vite v6.3.5 building for production...
Generated route tree in 64ms
✓ 12 modules transformed.
✗ Build failed in 165ms
error during build:
[vite-plugin-tanstack-start-create-server-fn] Missing semicolon. (1:5)
file: /Users/jawadsefiani/Projects/halal-foodie-next/apps/web/src/locales/fr/messages.po:1:5
at constructor (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:367:19)
at TypeScriptParserMixin.raise (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:6627:19)
at TypeScriptParserMixin.semicolon (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:6923:10)
at TypeScriptParserMixin.parseExpressionStatement (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:13285:10)
at TypeScriptParserMixin.parseExpressionStatement (/Users/jawadsefiani/Projects/halal-foodie-next/node_modules/.pnpm/@babel+parser@7.28.0/node_modules/@babel/parser/lib/index.js:9611:26)
I tried excluding the translation files from Babel, but it didn't help. Trying to figure out whether this is a TanStack start issue or not. Anyone who can help?
14 Replies
eager-peach
eager-peach4w ago
can you please provide a complete example?
foreign-sapphire
foreign-sapphireOP4w ago
by complete example are you referring to a sandbox or specific files?
eager-peach
eager-peach4w ago
a sandbox seems like start tries to parse that file but should not so a reproducer project would be helpful
foreign-sapphire
foreign-sapphireOP4w ago
alright will provide a sandbox (at the latest Tuesday)
deep-jade
deep-jade4w ago
If this can help, I have fresly added Lingui to my project
deep-jade
deep-jade4w ago
No description
No description
No description
No description
No description
No description
No description
No description
No description
foreign-sapphire
foreign-sapphireOP4w ago
@ティボ Do you have the same issue?
deep-jade
deep-jade4w ago
No issue on my side, it compile.
foreign-sapphire
foreign-sapphireOP4w ago
Alright, had a closer look at the screenshots, that seems like an outdated setup, the Lingui team is working on a new setup recommendation: https://github.com/lingui/js-lingui/pull/2267
GitHub
fix(examples): devinxi Tanstack Start example by depsimon · Pull R...
Description This PR updates the tanstack-start example to use the latest version which relies on vite instead of vinxi. It also updates to tailwind 4 Types of changes Bugfix (non-breaking change ...
deep-jade
deep-jade4w ago
My version is indeed based on the old example which I manually migrated following the migration doc from tanstack.
foreign-sapphire
foreign-sapphireOP2w ago
@Manuel Schiller Sorry for the delay, but here is the repo I promised: https://github.com/jsefiani/start-basic, let me know if you have any questions!
eager-peach
eager-peach2w ago
so it tries to parse the .po file? interesting can you please create a github issue for this and link the reproducer for it?
foreign-sapphire
foreign-sapphireOP7d ago
Yeah indeed Alright will do 👍
foreign-sapphire
foreign-sapphireOP3d ago
GitHub
TanStack Start plugin attempts to compile po files and fails · Iss...
Which project does this relate to? Start Describe the bug The TanStack start plugin attempts to compile PO files and fails; ideally, the plugin should ignore them. Your Example Website or App https...

Did you find this page helpful?