$ astro info
Astro v5.0.1
Node v23.2.0
System Windows (x64)
Package Manager bun
Output server
Adapter @astrojs/vercel
Integrations @astrojs/tailwind
@astrojs/sitemap
@astrojs/mdx
astro-icon
If this issue only occurs in one browser, which browser is a problem?
Firefox
Describe the Bug
For file src/utils.ts
export function A() {
// Used in dynamic astro page P
}
export function B() {
// Used as a static typescript function in a simple component S using <script>import xxx</script>
}
but when component S inserted in dynamic server page P, astro seems cannot split out scripts and shows warnings.
Note: this method can work on Astro v4.x
The "astro:content" module is only available server-side.
Stack Trace
at generateContentEntryFile (file:///D:/code/web/astro-theme-pure/node_modules/astro/dist/content/vite-plugin-content-virtual-mod.js:197:11)
at LoadPluginContext.load (file:///D:/code/web/astro-theme-pure/node_modules/astro/dist/content/vite-plugin-content-virtual-mod.js:93:28)
at EnvironmentPluginContainer.load (file:///D:/code/web/astro-theme-pure/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:46981:17)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async loadAndTransform (file:///D:/code/web/astro-theme-pure/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:40782:22)
at async viteTransformMiddleware (file:///D:/code/web/astro-theme-pure/node_modules/vite/dist/node/chunks/dep-A4nAWF7x.js:42292:24)
What's the expected result?
// src/utils.ts
export function A() {
// Used in dynamic astro page P
}
export function B() {
// Used as a static typescript function in a simple component S using <script>import xxx</script>
}
When component S inserted in dynamic server page P, astro can work well.
Link to Minimal Reproducible Example
I'll append if it is needed
Participation
[ ] I am willing to submit a pull request for this issue.
Hello @cworld1. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Firefox
Describe the Bug
For file
src/utils.ts
but when component S inserted in dynamic server page P, astro seems cannot split out scripts and shows warnings.
What's the expected result?
When component S inserted in dynamic server page P, astro can work well.
Link to Minimal Reproducible Example
I'll append if it is needed
Participation