-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
Ever since version 1.3.1 the entirety of process.env is being overwritten with an object containing a single key, { SVELTEKIT_FORK: true }. Using SvelteKit's $env/static/private handling works, but process.env is still totally overwritten. I'm not sure if this is by design.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-u765us?file=package.json
This repo does not show the entire process.env being overwritten, probably due to the different functioning of WebContainers to Netlify's environment. You can still notice env variables being overwritten by changing between versions 1.3.0 and 1.3.1.
v1.3.0:
process.env {
COLORTERM: 'truecolor',
TERM: 'xterm-256color',
LSCOLORS: 'ExGxBxDxCxEgEdxbxgExEx',
PATH: '/home/projects/sveltejs-kit-template-default-u765us/node_modules/.bin:/home/projects/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/bin:/usr/bin:/usr/local/bin',
HOME: '/home',
SHELL: '/bin/jsh',
HISTFILE: '/home/.jsh_history',
TMPDIR: '/tmp',
CHROME_BIN: '/usr/local/bin/google-chrome',
GIT_PROXY: 'https://p.stackblitz.com',
PWD: '/home/projects/sveltejs-kit-template-default-u765us',
NEXT_TELEMETRY_DISABLED: '1',
ASTRO_TELEMETRY_DISABLED: '1',
__NEXT_DISABLE_MEMORY_WATCHER: '1',
NG_CLI_ANALYTICS: 'false',
EDITOR: 'code',
PKG_MANAGER: 'npm',
NODE_ENV: 'production'
}
v1.3.1
process.env {
COLORTERM: 'truecolor',
TERM: 'xterm-256color',
LSCOLORS: 'ExGxBxDxCxEgEdxbxgExEx',
PATH: '/bin:/usr/bin:/usr/local/bin',
HOME: '/home',
SHELL: '/bin/jsh',
HISTFILE: '/home/.jsh_history',
TMPDIR: '/tmp',
CHROME_BIN: '/usr/local/bin/google-chrome',
GIT_PROXY: 'https://p.stackblitz.com',
PWD: '/home/projects/sveltejs-kit-template-default-u765us',
SVELTEKIT_FORK: 'true'
}
Logs
12:21:09 AM: Netlify Build
12:21:09 AM: ────────────────────────────────────────────────────────────────
12:21:09 AM:
12:21:09 AM: ❯ Version
12:21:09 AM: @netlify/build 29.5.1
12:21:09 AM:
12:21:09 AM: ❯ Flags
12:21:09 AM: baseRelDir: true
12:21:09 AM: buildId: 63d5bbde011c720008ba785d
12:21:09 AM: deployId: 63d5bbde011c720008ba785f
12:21:09 AM:
12:21:09 AM: ❯ Current directory
12:21:09 AM: /opt/build/repo/sites/web
12:21:09 AM:
12:21:09 AM: ❯ Config file
12:21:09 AM: /opt/build/repo/sites/web/netlify.toml
12:21:09 AM:
12:21:09 AM: ❯ Context
12:21:09 AM: production
12:21:09 AM:
12:21:09 AM: ❯ Loading plugins
12:21:09 AM: - @netlify/[email protected] from Netlify app
12:21:11 AM:
12:21:11 AM: 1. build.command from netlify.toml
12:21:11 AM: ────────────────────────────────────────────────────────────────
12:21:11 AM:
12:21:11 AM: $ npm run build
12:21:11 AM: > [email protected] build
12:21:11 AM: > vite build
12:21:11 AM: ▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
12:21:11 AM: tsconfig.json:2:13:
12:21:11 AM: 2 │ "extends": "./.svelte-kit/tsconfig.json",
12:21:11 AM: ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12:21:12 AM: vite v4.0.4 building SSR bundle for production...
12:21:12 AM: transforming...
12:21:14 AM: ../assets/fonts/font.woff2 referenced in /opt/build/repo/sites/web/src/styles/global.scss didn't resolve at build time, it will remain unchanged to be resolved at runtime
✓ 115 modules transformed.
12:21:14 AM: 12:21:14 AM [vite-plugin-svelte] ssr compile done.
12:21:14 AM: package files time avg
12:21:14 AM: tickets 11 0.32s 28.7ms
12:21:14 AM: @portabletext/svelte 15 51.6ms 3.4ms
12:21:14 AM: @sveltejs/kit 2 21.4ms 10.7ms
12:21:14 AM: Generated an empty chunk: "entries/endpoints/api/booking/_server.ts".
12:21:14 AM: rendering chunks...
... CHUNKS BEING RENDERED HERE
12:21:15 AM: .svelte-kit/output/client/_app/immutable/components/pages/(public)/_page.svelte-9b90a5a9.js 84.67 kB │ gzip: 13.23 kB
12:21:16 AM: { SVELTEKIT_FORK: 'true' } <-- This is just me writing `console.log(process.env)` in a file imported by a +server.ts fileSystem Info
This was observed on a standard Netlify deployment with adapter-auto, however the only changes in the package-lock file between a system with a successful build and one with a failed one are with '@sveltejs/kit': 1.3.1, so I would assume the issue is not in the Netlify or auto adapters.
Severity
annoyance
Additional Information
No response