Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a7be39e

Browse files
florian-lefebvresarah11918
andauthoredAug 21, 2024
feat(next): make astro:env stable (#11679)
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
1 parent c25c180 commit a7be39e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed
 

‎packages/adapters/node/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function getAdapter(options: Options): AstroAdapter {
1818
isSharpCompatible: true,
1919
},
2020
i18nDomains: 'experimental',
21-
envGetSecret: 'experimental',
21+
envGetSecret: 'stable',
2222
},
2323
};
2424
}

‎packages/adapters/node/src/server.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import type { SSRManifest } from 'astro';
22
import { NodeApp, applyPolyfills } from 'astro/app/node';
3+
import { setGetEnv } from 'astro/env/setup';
34
import createMiddleware from './middleware.js';
45
import { createStandaloneHandler } from './standalone.js';
56
import startServer from './standalone.js';
67
import type { Options } from './types.js';
8+
79
// This needs to run first because some internals depend on `crypto`
810
applyPolyfills();
9-
10-
// Won't throw if the virtual module is not available because it's not supported in
11-
// the users's astro version or if astro:env is not enabled in the project
12-
await import('astro/env/setup')
13-
.then((mod) => mod.setGetEnv((key) => process.env[key]))
14-
.catch(() => {});
11+
setGetEnv((key) => process.env[key]);
1512

1613
export function createExports(manifest: SSRManifest, options: Options) {
1714
const app = new NodeApp(manifest);

0 commit comments

Comments
 (0)
Please sign in to comment.