Description
On the build time or page load it fails because of date in more packages.
`Error: Error during dependency optimization:
Build failed with 3 errors:
[PARSE_ERROR] Expected , or ) but found ?
╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/datepicker/Datepicker.svelte:458:26 ]
│
458 │ const formatDate = (date?) => date?.toLocaleDateString(locale(), $$props.dateFormat) ?? "";
│ ┬ ┬
│ ╰─────── Opened here
│ │
│ ╰── , or ) expected
─────╯
[PARSE_ERROR] Expected , or ) but found ?
╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/command-palette/CommandPalette.svelte:79:20 ]
│
79 │ const check = (x?) => x?.toLowerCase().includes(searchLower);
│ ┬ ┬
│ ╰──── Opened here
│ │
│ ╰── , or ) expected
────╯
[PARSE_ERROR] Expected , or ) but found ?
╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/scroll-spy/ScrollSpy.svelte:97:40 ]
│
97 │ function scrollToSection(itemId, event?) {
│ ┬ ┬
│ ╰──────────────── Opened here
│ │
│ ╰── , or ) expected
────╯
at aggregateBindingErrorsIntoJsError (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/shared/error-BuvQYXuZ.mjs:48:18)
at unwrapBindingResult (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/shared/error-BuvQYXuZ.mjs:18:128)
at #build (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/shared/rolldown-build-CrPk_lZe.mjs:3246:34)
at async Object.build (file:///app/node_modules/.pnpm/vite@8.0.16_@types+node@26.0.0_jiti@2.7.0/node_modules/vite/dist/node/chunks/node.js:31848:11) {
errors: [Getter/Setter]
}`
Minimal Reproduction
No code related.
The error appear at:
- build
- page run
I have try to downgrade vite to 7 - same.
Upgrade to floabite svelte 2
Clean tsconfig
And more
Steps to Reproduce
Clean project
Environment
System:
OS: Linux 6.1 Debian GNU/Linux 13 (trixie) 13 (trixie)
CPU: (16) x64 Intel Xeon Processor (Skylake, IBRS, no TSX)
Memory: 17.94 GB / 30.60 GB
Container: Yes
Shell: 5.2.37 - /bin/bash
Binaries:
Node: 26.3.1 - /usr/local/bin/node
npm: 11.16.0 - /usr/local/bin/npm
pnpm: 11.8.0 - /usr/local/bin/pnpm
npmPackages:
@sveltejs/kit: ^2.66.0 => 2.66.0
flowbite: ^4.0.2 => 4.0.2
flowbite-svelte: ^1.33.1 => 1.33.1
svelte: ^5.56.3 => 5.56.3
vite: ^8.0.16 => 8.0.16
Relevant Logs / Console Output
[500] GET /user/login
RolldownError: Parse failure: Parse failed with 1 error:
Expected `,` or `)` but found `?`
336:
337: // Use locale for formatting (not finalTranslationLocale)
338: const formatDate = (date?) => date?.toLocaleDateString(locale, dateFormat) ?? "";
^
339:
340: const isSameDate = (date1?, date2?) => date1 && date2 ? isSameDay(date1, date2) : false;
336:
337: // Use locale for formatting (not finalTranslationLocale)
338: const formatDate = (date?) => date?.toLocaleDateString(locale, dateFormat) ?? "";
^
339:
340: const isSameDate = (date1?, date2?) => date1 && date2 ? isSameDay(date1, date2) : false;
At file: /node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/datepicker/Datepicker.svelte?v=1fd87802:338:27
at error (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs:147:24)
at normalizeParseError (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/parse-ast-index.mjs:25:9)
at wrap (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/parse-ast-index.mjs:5:39)
at parseAstAsync (file:///app/node_modules/.pnpm/rolldown@1.0.3/node_modules/rolldown/dist/parse-ast-index.mjs:54:9)
at async ssrTransformScript (file:///app/node_modules/.pnpm/vite@8.0.16_@types+node@26.0.0_jiti@2.7.0/node_modules/vite/dist/node/chunks/node.js:11179:9)
at async loadAndTransform (file:///app/node_modules/.pnpm/vite@8.0.16_@types+node@26.0.0_jiti@2.7.0/node_modules/vite/dist/node/chunks/node.js:24680:64)
Screenshots / GIF (optional)
No response
Additional Context (optional)
Pakage.json
`
{
"name": "blb",
"private": true,
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite dev --host",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-node": "^5.5.4",
"@sveltejs/kit": "^2.66.0",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/vite": "^4.3.1",
"@types/node": "^26.0.0",
"flowbite": "^4.0.2",
"flowbite-svelte": "^1.33.1",
"flowbite-svelte-icons": "^3.1.0",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",
"tailwindcss": "^4.3.1",
"typescript": "^6.0.3",
"vite": "^8.0.16"
},
"dependencies": {
"jose": "^6.2.3",
"tailwind-variants": "^3.2.2"
}
}
`
Vite config
`import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
tailwindcss(),
sveltekit()
],
optimizeDeps: {
exclude: [
'flowbite-svelte',
'flowbite-svelte-icons'
]
},
ssr: {
noExternal: [
'flowbite-svelte',
'flowbite-svelte-icons'
]
},
server: {
allowedHosts: ['localhost']
}
});
`
Checklist
Description
On the build time or page load it fails because of date in more packages.
`Error: Error during dependency optimization:
Build failed with 3 errors:
[PARSE_ERROR] Expected
,or)but found?╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/datepicker/Datepicker.svelte:458:26 ]
│
458 │ const formatDate = (date?) => date?.toLocaleDateString(locale(), $$props.dateFormat) ?? "";
│ ┬ ┬
│ ╰─────── Opened here
│ │
│ ╰──
,or)expected─────╯
[PARSE_ERROR] Expected
,or)but found?╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/command-palette/CommandPalette.svelte:79:20 ]
│
79 │ const check = (x?) => x?.toLowerCase().includes(searchLower);
│ ┬ ┬
│ ╰──── Opened here
│ │
│ ╰──
,or)expected────╯
[PARSE_ERROR] Expected
,or)but found?╭─[ node_modules/.pnpm/flowbite-svelte@1.33.1_rollup@4.62.2_svelte@5.56.3_tailwindcss@4.3.1/node_modules/flowbite-svelte/dist/scroll-spy/ScrollSpy.svelte:97:40 ]
│
97 │ function scrollToSection(itemId, event?) {
│ ┬ ┬
│ ╰──────────────── Opened here
│ │
│ ╰──
,or)expected────╯
errors: [Getter/Setter]
}`
Minimal Reproduction
Steps to Reproduce
Clean project
Environment
System: OS: Linux 6.1 Debian GNU/Linux 13 (trixie) 13 (trixie) CPU: (16) x64 Intel Xeon Processor (Skylake, IBRS, no TSX) Memory: 17.94 GB / 30.60 GB Container: Yes Shell: 5.2.37 - /bin/bash Binaries: Node: 26.3.1 - /usr/local/bin/node npm: 11.16.0 - /usr/local/bin/npm pnpm: 11.8.0 - /usr/local/bin/pnpm npmPackages: @sveltejs/kit: ^2.66.0 => 2.66.0 flowbite: ^4.0.2 => 4.0.2 flowbite-svelte: ^1.33.1 => 1.33.1 svelte: ^5.56.3 => 5.56.3 vite: ^8.0.16 => 8.0.16Relevant Logs / Console Output
Screenshots / GIF (optional)
No response
Additional Context (optional)
Pakage.json
`
{
"name": "blb",
"private": true,
"version": "1.0.1",
"type": "module",
"scripts": {
"dev": "vite dev --host",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-node": "^5.5.4",
"@sveltejs/kit": "^2.66.0",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/vite": "^4.3.1",
"@types/node": "^26.0.0",
"flowbite": "^4.0.2",
"flowbite-svelte": "^1.33.1",
"flowbite-svelte-icons": "^3.1.0",
"svelte": "^5.56.3",
"svelte-check": "^4.6.0",
"tailwindcss": "^4.3.1",
"typescript": "^6.0.3",
"vite": "^8.0.16"
},
"dependencies": {
"jose": "^6.2.3",
"tailwind-variants": "^3.2.2"
}
}
`
Vite config
`import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
tailwindcss(),
sveltekit()
],
optimizeDeps: {
exclude: [
'flowbite-svelte',
'flowbite-svelte-icons'
]
},
ssr: {
noExternal: [
'flowbite-svelte',
'flowbite-svelte-icons'
]
},
server: {
allowedHosts: ['localhost']
}
});
`
Checklist