Skip to content

build.assetsPrefix not exposed from astro:config/server #16604

@fragglebob

Description

@fragglebob

Astro Info

Astro                    v6.1.9
Node                     v24.13.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/netlify (v7.0.8)
Integrations             @astrojs/react (v5.0.4)
                         @sanity/astro (v3.3.1)
                         @sentry/astro (v10.49.0)

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

With import.meta.env.ASSETS_PREFIX being marked as deprecated since v6, and marked for removal in v7. The recommendation is to: "Use build.assetsPrefix from astro:config/server instead.".

However, it seems that assetsPrefix isn't available from build at the moment.

I can see in the types for ServerDeserializedManifest that only 'server' | 'client' | 'format' are picked at properties for build.

export type ServerDeserializedManifest = Pick<
SSRManifest,
'base' | 'trailingSlash' | 'compressHTML' | 'site'
> &
DeserializedDirs & {
i18n: AstroConfig['i18n'];
build: Pick<AstroConfig['build'], 'server' | 'client' | 'format'>;
root: URL;
image: Pick<AstroConfig['image'], 'objectFit' | 'objectPosition' | 'layout'>;
};

And also the virtual module only seems to create build with the same properties for build.

const build = {
server: new URL(manifest.buildServerDir),
client: new URL(manifest.buildClientDir),
format: manifest.buildFormat,
};

What's the expected result?

I'd expect the assetsPrefix to be available a property on build exposed from astro:config/server, given import.meta.env.ASSETS_PREFIX is marked as deprecated.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-xcvsfjqd?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions