Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git commit message with reserved word cannot build in GitLab CI #6102

Closed
chrisfromredfin opened this issue Aug 19, 2022 · 6 comments
Closed
Assignees
Labels
blocked by upstream bug Something isn't working $env Bugs related to the `$env` family of modules p3-edge-case SvelteKit cannot be used in an uncommon way
Milestone

Comments

@chrisfromredfin
Copy link

Describe the bug

OK here's a weirdo one. I build my project using yarn build (vite build) in GitLab CI, then rsync the compiled bundle/code to my server that's running a simple node server (i.e. I'm using adapter-node), and then GitLab CI then restarts the service on the remote.

I am actually writing this because I've updated Kit to the very latest today, and I had to re-work how I was using environment variables (I shifted from import.meta.env to $env/static/public and $env/static/private).

My commit message was then something like "refactor to remove import.meta.env" -- but GitLab puts certain environment variables in the build environment, such as CI_COMMIT_TITLE. Kit then tries to pull them all in to the static build, but as it contains the word "import," it is rejected, and my build soft fails.

I think that this is happening in kit/src/core/env.js (that's where I found references to this being a reserved word).

Looking up at utils.js/get_env, it doesn't seem there's a way to ignore/exclude certain variables from the build. (This would work for me as all GitLab's variables start with CI_ and I could filter those out.)

After I did another commit message without a reserved word, all was fine with the build.

Using

  • @sveltejs/kit 1.0.0-next.427
  • vite 3.0.9

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-gvupwf?file=src/routes/+page.svelte

Once in the stackblitz, stop the development server and issue:

CI_COMMIT_TITLE="do not use import.meta.env" npm run build

And the error happens.

Logs

====== GitLab Runner output ========

�[0KRunning with gitlab-runner 14.8.1 (6a42249e)�[0;m
�[0K  on poppie 0cc5fdb6�[0;m
section_start:1660937353:prepare_executor
�[0K�[0K�[36;1mPreparing the "docker" executor�[0;m�[0;m
�[0KUsing Docker executor with image jerry.redfinsolutions.com:4567/redfin/d9-rfs:latest ...�[0;m
�[0KAuthenticating with credentials from $DOCKER_AUTH_CONFIG�[0;m
�[0KPulling docker image jerry.redfinsolutions.com:4567/redfin/d9-rfs:latest ...�[0;m
�[0;33mWARNING: Failed to pull image with policy "always": Error response from daemon: Get https://jerry.redfinsolutions.com:4567/v2/redfin/d9-rfs/manifests/latest: unauthorized: HTTP Basic: Access denied (manager.go:203:0s)�[0;m
�[32;1mAttempt #2: Trying "if-not-present" pull policy�[0;m
�[0KUsing locally found image version due to "if-not-present" pull policy�[0;m
�[0KUsing docker image sha256:803a92719e02fc5d441f574f31393b7152504b987da5b7e3b981ecde302cecff for jerry.redfinsolutions.com:4567/redfin/d9-rfs:latest with digest jerry.redfinsolutions.com:4567/redfin/d9-rfs@sha256:d6bebd812789a2d31a6d6a8bed1086e63d40a4180540acd5ba4fa25e5ea1d61d ...�[0;m
section_end:1660937354:prepare_executor
�[0Ksection_start:1660937354:prepare_script
�[0K�[0K�[36;1mPreparing environment�[0;m�[0;m
Running on joey via poppie.redfinsolutions.com...
section_end:1660937355:prepare_script
�[0Ksection_start:1660937355:get_sources
�[0K�[0K�[36;1mGetting source from Git repository�[0;m�[0;m
�[32;1mFetching changes with git depth set to 50...�[0;m
Reinitialized existing Git repository in /ebsvol/gitlab-runner/builds_dir/redfin/silo/.git/
�[32;1mChecking out 3d82dfd6 as main...�[0;m
Removing frontend/.svelte-kit/
Removing frontend/node_modules/
Removing vendor/

�[32;1mSkipping Git submodules setup�[0;m
section_end:1660937357:get_sources
�[0Ksection_start:1660937357:restore_cache
�[0K�[0K�[36;1mRestoring cache�[0;m�[0;m
�[32;1mChecking cache for main-protected...�[0;m
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.�[0;m 
�[32;1mSuccessfully extracted cache�[0;m
section_end:1660937358:restore_cache
�[0Ksection_start:1660937358:step_script
�[0K�[0K�[36;1mExecuting "step_script" stage of the job script�[0;m�[0;m
�[0KUsing docker image sha256:803a92719e02fc5d441f574f31393b7152504b987da5b7e3b981ecde302cecff for jerry.redfinsolutions.com:4567/redfin/d9-rfs:latest with digest jerry.redfinsolutions.com:4567/redfin/d9-rfs@sha256:d6bebd812789a2d31a6d6a8bed1086e63d40a4180540acd5ba4fa25e5ea1d61d ...�[0;m
�[32;1m$ which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )�[0;m
/usr/bin/ssh-agent
�[32;1m$ eval $(ssh-agent -s)�[0;m
Agent pid 12
�[32;1m$ echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null�[0;m
Identity added: (stdin) ((stdin))
�[32;1m$ mkdir -p ~/.ssh�[0;m
�[32;1m$ chmod 700 ~/.ssh�[0;m
�[32;1m$ echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts�[0;m
�[32;1m$ chmod 644 ~/.ssh/known_hosts�[0;m
�[32;1m$ composer install --no-dev -o --no-interaction�[0;m
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Nothing to install, update or remove
Generating optimized autoload files
46 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
�[32;1m$ source /root/.nvm/nvm.sh && nvm install 16 && nvm use 16 && cd frontend && yarn install && yarn run build && cd ..�[0;m
Downloading and installing node v16.17.0...
Downloading https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz...
#=#=#                                                                         

###########                                                               15.3%
##########################################                                59.2%
#######################################################################   99.5%
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.17.0 (npm v8.15.0)
Now using node v16.17.0 (npm v8.15.0)
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 12.01s.
yarn run v1.22.17
$ vite build
�[36mvite v3.0.9 �[32mbuilding for production...�[36m�[39m
transforming...
�[32m✓�[39m 133 modules transformed.
rendering chunks...
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/logo-fb233249.svg                                          �[39m �[2m1.42 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/rblogo-122a3233.svg                                        �[39m �[2m1.12 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/hive-logo-ad4fa3ca.svg                                     �[39m �[2m1.07 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/taiga-d32ca588.svg                                         �[39m �[2m1.12 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-ext-400-normal-df8fd002.woff2           �[39m �[2m17.06 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-greek-400-normal-716e9e0f.woff2                  �[39m �[2m8.67 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-hebrew-400-normal-aaa9af21.woff2                 �[39m �[2m7.38 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-vietnamese-400-normal-4029d256.woff2             �[39m �[2m6.97 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-ext-400-normal-e3d26484.woff2              �[39m �[2m12.65 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-400-normal-9434dddc.woff2                  �[39m �[2m16.33 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-ext-600-normal-61607f75.woff2           �[39m �[2m17.11 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-600-normal-c50e9125.woff2               �[39m �[2m9.82 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-greek-600-normal-c14d48a7.woff2                  �[39m �[2m8.76 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-hebrew-600-normal-376b2f33.woff2                 �[39m �[2m7.41 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-vietnamese-600-normal-e3a2965e.woff2             �[39m �[2m7.02 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-ext-600-normal-efe80523.woff2              �[39m �[2m12.67 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-600-normal-511b67b0.woff2                  �[39m �[2m16.40 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-ext-700-normal-7d9bdb20.woff2           �[39m �[2m16.54 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-700-normal-23f56ffb.woff2               �[39m �[2m9.64 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-greek-700-normal-27b24d98.woff2                  �[39m �[2m8.61 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-hebrew-700-normal-2b0539af.woff2                 �[39m �[2m7.37 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-vietnamese-700-normal-2bb39cab.woff2             �[39m �[2m6.89 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-ext-700-normal-9754e1f0.woff2              �[39m �[2m12.40 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-latin-700-normal-e3f25c51.woff2                  �[39m �[2m15.98 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-cyrillic-ext-700-normal-f1b35279.woff2          �[39m �[2m8.82 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-cyrillic-700-normal-06bbd095.woff2              �[39m �[2m7.97 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-latin-ext-700-normal-cc7345cd.woff2             �[39m �[2m10.32 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-latin-700-normal-f31b8056.woff2                 �[39m �[2m12.55 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-cyrillic-ext-400-normal-68ce5e02.woff2          �[39m �[2m8.68 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-cyrillic-400-normal-7849168d.woff2              �[39m �[2m7.82 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-latin-ext-400-normal-a663bd98.woff2             �[39m �[2m10.04 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-latin-400-normal-ddc148b8.woff2                 �[39m �[2m12.41 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/inconsolata-vietnamese-400-normal-23c5437a.woff2           �[39m �[2m6.68 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/inconsolata-latin-ext-400-normal-f8986368.woff2            �[39m �[2m14.43 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/inconsolata-latin-400-normal-4f9f98d7.woff2                �[39m �[2m15.86 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-cyrillic-400-normal-7f96afbe.woff2               �[39m �[2m9.85 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-all-400-normal-82a8e0e7.woff                     �[39m �[2m69.20 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-all-600-normal-dfa7e587.woff                     �[39m �[2m69.06 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/open-sans-all-700-normal-ca8f4dbd.woff                     �[39m �[2m67.12 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-all-700-normal-46a8b2d4.woff                    �[39m �[2m49.95 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/montserrat-all-400-normal-805f620f.woff                    �[39m �[2m49.58 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32m_app/immutable/assets/inconsolata-all-400-normal-04adc109.woff                   �[39m �[2m44.47 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[32mvite-manifest.json                                                               �[39m �[2m29.43 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/debug/env/_page.svelte-04cb9698.js               �[39m �[2m1.47 KiB / gzip: 0.77 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/my/hours/_page.svelte-0d8eff93.js                �[39m �[2m2.45 KiB / gzip: 1.14 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/_page.svelte-107c9b79.js                         �[39m �[2m15.72 KiB / gzip: 5.79 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/my/tasks/_page.svelte-cd184459.js                �[39m �[2m2.07 KiB / gzip: 0.98 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/ops/sync/_page.svelte-1f2b876c.js                �[39m �[2m6.04 KiB / gzip: 2.25 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/pm/priorities/_page.svelte-e0d7cedb.js           �[39m �[2m14.62 KiB / gzip: 5.35 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/pm/resource-allocation/_page.svelte-bb88dd61.js  �[39m �[2m3.58 KiB / gzip: 1.65 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/pm/task-aging/_page.svelte-25184320.js           �[39m �[2m4.59 KiB / gzip: 2.02 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/error.svelte-ba40ce30.js                               �[39m �[2m1.54 KiB / gzip: 0.71 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/sync-schedule/_page.svelte-ef10a2e3.js           �[39m �[2m3.55 KiB / gzip: 1.23 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/modules/pages/sec/updates/_page.js-adaa7194.js                    �[39m �[2m0.11 KiB / gzip: 0.10 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/singletons-e5e57fbd.js                                     �[39m �[2m0.05 KiB / gzip: 0.07 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/index-d6fabef0.js                                          �[39m �[2m0.43 KiB / gzip: 0.28 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/stores-6417e525.js                                         �[39m �[2m0.53 KiB / gzip: 0.31 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/public-de53b5a8.js                                         �[39m �[2m0.28 KiB / gzip: 0.25 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/index-b0f516b1.js                                          �[39m �[2m16.42 KiB / gzip: 6.82 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/index-fb4c3a07.js                                          �[39m �[2m0.14 KiB / gzip: 0.14 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/index-4d0712f3.js                                          �[39m �[2m0.79 KiB / gzip: 0.37 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/_helpers-c0b00fab.js                                       �[39m �[2m2.05 KiB / gzip: 0.99 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/dayjs.min-244924c2.js                                      �[39m �[2m6.35 KiB / gzip: 2.86 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/_layout.svelte-3f37f4a9.js                       �[39m �[2m23.82 KiB / gzip: 13.38 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/RedfinSpinner-fbf1779b.js                                  �[39m �[2m1.87 KiB / gzip: 0.95 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/isSameOrBefore-4c3ce22f.js                                 �[39m �[2m0.27 KiB / gzip: 0.19 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/UserHoursTable-60ce13da.js                                 �[39m �[2m7.96 KiB / gzip: 2.88 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/_commonjsHelpers-094ef602.js                               �[39m �[2m0.13 KiB / gzip: 0.09 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/TaskLink-0e886d2e.js                                       �[39m �[2m2.52 KiB / gzip: 1.17 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/_page-dbced1cf.js                                          �[39m �[2m0.31 KiB / gzip: 0.25 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/0-d128067e.js                                              �[39m �[2m0.32 KiB / gzip: 0.21 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/2-16475788.js                                              �[39m �[2m0.48 KiB / gzip: 0.28 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/3-830a9202.js                                              �[39m �[2m0.16 KiB / gzip: 0.14 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/my/status/_page.svelte-ce76e27d.js               �[39m �[2m29.69 KiB / gzip: 10.67 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/4-f5d745dd.js                                              �[39m �[2m0.30 KiB / gzip: 0.21 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/5-4104c238.js                                              �[39m �[2m0.33 KiB / gzip: 0.22 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/6-4150cb74.js                                              �[39m �[2m0.29 KiB / gzip: 0.21 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/7-32a61f7b.js                                              �[39m �[2m0.16 KiB / gzip: 0.15 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/9-d30f8499.js                                              �[39m �[2m0.35 KiB / gzip: 0.23 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/10-bef4f1d1.js                                             �[39m �[2m0.20 KiB / gzip: 0.16 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/11-800355c0.js                                             �[39m �[2m0.33 KiB / gzip: 0.20 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/12-85c60980.js                                             �[39m �[2m0.13 KiB / gzip: 0.13 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/RedfinSpinner-5cc81953.css                                 �[39m �[2m0.29 KiB / gzip: 0.17 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-14455fa0.css                                         �[39m �[2m1.00 KiB / gzip: 0.44 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/UserSelect-51ce3f2c.js                                     �[39m �[2m43.14 KiB / gzip: 14.95 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/UserHoursTable-ad021614.css                                �[39m �[2m2.17 KiB / gzip: 0.57 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-b820ac6d.css                                         �[39m �[2m0.24 KiB / gzip: 0.17 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-44557bde.css                                         �[39m �[2m0.61 KiB / gzip: 0.24 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/8-548f7bb1.js                                              �[39m �[2m0.32 KiB / gzip: 0.21 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/TaskLink-1269a512.css                                      �[39m �[2m0.12 KiB / gzip: 0.11 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-8a841b44.css                                         �[39m �[2m4.02 KiB / gzip: 0.95 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-d788d599.css                                         �[39m �[2m0.19 KiB / gzip: 0.13 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-8fea6c98.css                                         �[39m �[2m0.17 KiB / gzip: 0.10 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/UserSelect-cc329166.css                                    �[39m �[2m9.06 KiB / gzip: 2.41 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-3797a5bf.css                                         �[39m �[2m0.04 KiB / gzip: 0.06 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+page-ce2a175c.css                                         �[39m �[2m0.07 KiB / gzip: 0.09 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/start-2eadef4b.js                                                 �[39m �[2m26.72 KiB / gzip: 9.46 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/GitlabMRsTable-19026bde.js                                 �[39m �[2m8.19 KiB / gzip: 3.00 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/components/pages/sec/updates/_page.svelte-4a8f58e8.js             �[39m �[2m43.37 KiB / gzip: 14.56 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[36m_app/immutable/chunks/1-22492f41.js                                              �[39m �[2m0.14 KiB / gzip: 0.13 KiB�[22m
�[90m�[37m�[2m.svelte-kit/output/client/�[22m�[90m�[39m�[35m_app/immutable/assets/+layout-39835336.css                                       �[39m �[2m39.17 KiB / gzip: 20.44 KiB�[22m
�[36mvite v3.0.9 �[32mbuilding SSR bundle for production...�[36m�[39m
transforming...
�[32m✓�[39m 60 modules transformed.
�[31mUnexpected token (Note that you need plugins to import files that are not JavaScript)�[39m
file: �[36m�$env/static/private:351:54�[39m
�[33m349: 
350: /** @type {import('$env/static/private').CI_COMMIT_TITLE} */
351: export const CI_COMMIT_TITLE = "will not build with import.meta.env";
                                                           ^
352: 
353: /** @type {import('$env/static/private').CI_PROJECT_TITLE} */�[39m
�[31m[vite-plugin-svelte-kit] Unexpected token (Note that you need plugins to import files that are not JavaScript)�[39m
file: �[36m�$env/static/private:351:54�[39m
�[33m349: 
350: /** @type {import('$env/static/private').CI_COMMIT_TITLE} */
351: export const CI_COMMIT_TITLE = "will not build with import.meta.env";
                                                           ^
352: 
353: /** @type {import('$env/static/private').CI_PROJECT_TITLE} */�[39m
�[31merror during build:
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (file:///ebsvol/gitlab-runner/builds_dir/redfin/silo/frontend/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at Module.error (file:///ebsvol/gitlab-runner/builds_dir/redfin/silo/frontend/node_modules/rollup/dist/es/shared/rollup.js:12412:16)
    at Module.tryParse (file:///ebsvol/gitlab-runner/builds_dir/redfin/silo/frontend/node_modules/rollup/dist/es/shared/rollup.js:12789:25)
    at Module.setSource (file:///ebsvol/gitlab-runner/builds_dir/redfin/silo/frontend/node_modules/rollup/dist/es/shared/rollup.js:12694:24)
    at ModuleLoader.addModuleSource (file:///ebsvol/gitlab-runner/builds_dir/redfin/silo/frontend/node_modules/rollup/dist/es/shared/rollup.js:22136:20)�[39m
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
�[32;1m$ rsync -avz --no-perms --no-owner --no-group --exclude-from=".exclude" --delete-after -e 'ssh -p 22' . [email protected]:src/silo-cli�[0;m
rsync: failed to open exclude file .exclude: No such file or directory (2)
rsync error: error in file IO (code 11) at exclude.c(1178) [client=3.1.2]
section_end:1660937387:step_script
�[0Ksection_start:1660937387:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1660937388:cleanup_file_variables
�[0K�[31;1mERROR: Job failed: exit code 1
�[0;m

System Info

System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1 Pro
    Memory: 73.84 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2022.06.06.00 - /opt/homebrew/bin/watchman
  Browsers:
    Brave Browser: 104.1.42.95
    Chrome: 104.0.5112.101
    Firefox Developer Edition: 104.0
    Safari: 15.5
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0-next.50 => 1.0.0-next.64
    @sveltejs/adapter-node: ^1.0.0-next.67 => 1.0.0-next.86
    @sveltejs/kit: ^1.0.0-next.260 => 1.0.0-next.424
    svelte: ^3.44.0 => 3.49.0
    vite: ^3.0.9 => 3.0.9

Severity

annoyance

Additional Information

I think the proper thing would be to write in a way to exclude certain variables or a certain RegEx of variables as "do not build these into env/static"

I think this would happen maybe in get_env:

/**
 * Load environment variables from process.env and .env files
 * @param {string} mode
 * @param {string} prefix
 */
export function get_env(mode, prefix) {
	const entries = Object.entries(loadEnv(mode, process.cwd(), ''));

	return {
		public: Object.fromEntries(entries.filter(([k]) => k.startsWith(prefix))),
		private: Object.fromEntries(entries.filter(([k]) => !k.startsWith(prefix)))
	};
}

...with perhaps an additional entries.filter??

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Oh my gosh, I usually feel bad when features I implement introduce a bug, but honestly, even on my absolute best day ever, I would never have seen this one coming.

@elliott-with-the-longest-name-on-github
Copy link
Contributor

I'm not so sure this is a Kit issue, though, at least not if the issue is caused by what we think it is. Regardless of the fact that the environment variable contains import.meta.env, it should be fine. It's being loaded as a string. I'll have to dig into this tomorrow to confirm.

@elliott-with-the-longest-name-on-github elliott-with-the-longest-name-on-github added bug Something isn't working p3-edge-case SvelteKit cannot be used in an uncommon way $env Bugs related to the `$env` family of modules labels Aug 20, 2022
@elliott-with-the-longest-name-on-github
Copy link
Contributor

I think this is an error somewhere in Vite. When I make a more minimal reproduction locally, I get the following:

image

Curious to see if any Viteheads have more to add...

@elliott-with-the-longest-name-on-github
Copy link
Contributor

Filed vitejs/vite#9790. Going to consider this "blocked by upstream" until we hear back from the team.

@chrisfromredfin
Copy link
Author

PR already open upstream!
vitejs/vite#9791

@Rich-Harris Rich-Harris added this to the whenever milestone Sep 3, 2022
@eltigerchino
Copy link
Member

eltigerchino commented Nov 12, 2024

This seems to be fixed by vitejs/vite#11151 and I can't reproduce the original issue either. Going to close this one as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by upstream bug Something isn't working $env Bugs related to the `$env` family of modules p3-edge-case SvelteKit cannot be used in an uncommon way
Projects
None yet
Development

No branches or pull requests

4 participants