Vite v8.0.6 bug: TypeError: promises.getDefaultResultOrder is not a function. #22187
-
|
Trying to run vite build I get a TypeError. #24 0.986 $ vite build
#24 1.192 error during build:
#24 1.192 TypeError: promises.getDefaultResultOrder is not a function. (In 'promises.getDefaultResultOrder()', 'promises.getDefaultResultOrder' is undefined)
#24 1.192 at getLocalhostAddressIfDiffersFromDNS (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:2067:15)
#24 1.192 at resolveHostname (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:2082:31)
#24 1.192 at resolveDevToolsConfig (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:33872:34)
#24 1.192 at resolveConfig (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:34317:39)
#24 1.192 at async createBuilder (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:33351:23)
#24 1.192 at async <anonymous> (/home/bun/app/node_modules/vite/dist/node/cli.js:767:25)
#24 1.192 at processTicksAndRejections (native:7:39)
#24 1.196 error: script "bundle" exited with code 1
#24 ERROR: process "/bin/sh -c bun run bundle" did not complete successfully: exit code: 1
"devDependencies": {
"@types/bun": "^1.3.11",
"eslint": "^10.2.0",
"vite": "^8.0.6"
},
"scripts": {
"bundle": "vite build",
"lint": "eslint --fix && eslint"
}I run via a # syntax=docker/dockerfile:1
ARG BUN_INSTALL_CACHE_DIR=/home/bun/.bun/install/cache
ARG WORKDIR=/home/bun/app
# https://hub.docker.com/r/oven/bun/tags
FROM docker.io/oven/bun:1.3.10-alpine AS base
ARG WORKDIR
WORKDIR ${WORKDIR}
# https://bun.sh/docs/install/cache
ARG BUN_INSTALL_CACHE_DIR
ENV BUN_INSTALL_CACHE_DIR=${BUN_INSTALL_CACHE_DIR}
FROM base AS bun-install
ARG BUN_INSTALL_CACHE_DIR
RUN --mount=type=secret,id=CI_JOB_TOKEN,env=CI_JOB_TOKEN \
--mount=type=cache,target=${BUN_INSTALL_CACHE_DIR} \
--mount=type=cache,target=./node_modules,id=node_modules \
--mount=type=bind,source=./package.json,target=./package.json \
--mount=type=bind,source=./bunfig.toml,target=./bunfig.toml \
--mount=type=bind,source=./bun.lock,target=./bun.lock \
bun install \
--cache-dir=${BUN_INSTALL_CACHE_DIR} \
# Don't update package.json or save a lockfile
--no-save
#--silent
FROM bun-install AS build-prod
# Bundle the app into the dist directory
COPY --link . .
ARG BUN_INSTALL_CACHE_DIR
RUN --mount=type=cache,target=${BUN_INSTALL_CACHE_DIR} \
--mount=type=cache,target=./node_modules,id=node_modules \
bun run bundleEDIT: Rolled vite back to 7.3.1, and now it works again. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Confirmed bug in Vite 8.0.6, fixed in 8.0.7. PR #22151 added a The fix in PR #22185 imports
|
Beta Was this translation helpful? Give feedback.
-
|
@travisbreaks ! Thank you ! 🎉 |
Beta Was this translation helpful? Give feedback.
-
|
@travisbreaks - Hitting new issue on Vite 8.0.8 [validate] #29 [frontend-builder bun-install 1/1] RUN --mount=type=secret,id=CI_JOB_TOKEN,env=CI_JOB_TOKEN --mount=type=cache,target=/home/bun/.bun/install/cache --mount=type=cache,target=./node_modules,id=node_modules --mount=type=bind,source=./package.json,target=./package.json --mount=type=bind,source=./bunfig.toml,target=./bunfig.toml --mount=type=bind,source=./bun.lock,target=./bun.lock bun install --cache-dir=/home/bun/.bun/install/cache --no-save
[validate] #29 0.229 bun install v1.3.11 (af24e281)
[validate] #29 0.245
[validate] #29 0.245 Checked 90 installs across 120 packages (no changes) [17.00ms]
[validate] #29 DONE 0.6s
...
[validate] #31 [frontend-builder build-prod 2/2] RUN --mount=type=cache,target=/home/bun/.bun/install/cache --mount=type=cache,target=./node_modules,id=node_modules bun run bundle
[validate] #31 1.956 $ vite build
[validate] #31 2.794 vite v8.0.8 building client environment for production...
transforming...✓ 21 modules transformed.
[validate] #31 3.640 ✗ Build failed in 843ms
[validate] #31 3.648 error during build:
[validate] #31 3.648 Build failed with 1 error:
[validate] #31 3.648
[validate] #31 3.648 [plugin vite:css-post]
[validate] #31 3.648 SyntaxError: [lightningcss minify] Invalid media query
[validate] #31 3.648 13929 | width: max-content;
[validate] #31 3.648 13930 | }
[validate] #31 3.648 13931 | @media screen and (min-width: var(--size-container-max)) {
[validate] #31 3.648 | ^
[validate] #31 3.648 13932 | .gv-activated .gv-storefront-section .gv-scroll-row.gv-wide-left {
[validate] #31 3.648 13933 | scroll-padding-left: calc(((100% - var(--size-container-max)) / 2) + var(--section-px));
[validate] #31 3.648 Error
[validate] #31 3.648 at transform (unknown)
[validate] #31 3.648 at <anonymous> (/home/bun/app/node_modules/lightningcss/node/index.js:56:14)
[validate] #31 3.648 at minifyCSS (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:21260:59)
[validate] #31 3.648 at async finalizeCss (/home/bun/app/node_modules/vite/dist/node/chunks/node.js:21106:42)
[validate] #31 3.648 at processTicksAndRejections (unknown:7:39)
[validate] #31 3.648 at aggregateBindingErrorsIntoJsError (/home/bun/app/node_modules/rolldown/dist/shared/error-w0u7biK-.mjs:48:22)
[validate] #31 3.648 at unwrapBindingResult (/home/bun/app/node_modules/rolldown/dist/shared/error-w0u7biK-.mjs:18:128)
[validate] #31 3.648 at #build (/home/bun/app/node_modules/rolldown/dist/shared/rolldown-build-DtGk-m96.mjs:3313:34)
[validate] #31 3.648 at processTicksAndRejections (native:7:39) {
[validate] #31 3.648 errors: [Getter/Setter]
[validate] #31 3.648 }
[validate] #31 3.682 error: script "bundle" exited with code 1
[validate] #31 ERROR: process "/bin/sh -c bun run bundle" did not complete successfully: exit code: 1 "devDependencies": {
"@types/bun": "1.3.11",
"eslint": "10.2.0",
"vite": "8.0.8"
},
"scripts": {
"bundle": "vite build",
"lint": "eslint --fix && eslint"
}# syntax=docker/dockerfile:1
ARG BUN_INSTALL_CACHE_DIR=/home/bun/.bun/install/cache
ARG WORKDIR=/home/bun/app
# https://hub.docker.com/r/oven/bun/tags
FROM docker.io/oven/bun:1.3.11-alpine AS base
ARG WORKDIR
WORKDIR ${WORKDIR}
# https://bun.sh/docs/install/cache
ARG BUN_INSTALL_CACHE_DIR
ENV BUN_INSTALL_CACHE_DIR=${BUN_INSTALL_CACHE_DIR}
RUN --mount=type=secret,id=CI_JOB_TOKEN,env=CI_JOB_TOKEN \
--mount=type=cache,target=${BUN_INSTALL_CACHE_DIR} \
--mount=type=cache,target=./node_modules,id=node_modules \
--mount=type=bind,source=./package.json,target=./package.json \
--mount=type=bind,source=./bunfig.toml,target=./bunfig.toml \
--mount=type=bind,source=./bun.lock,target=./bun.lock \
bun install \
--cache-dir=${BUN_INSTALL_CACHE_DIR} \
--no-save
# Bundle the app into the dist directory
COPY --link . .
ARG BUN_INSTALL_CACHE_DIR
RUN --mount=type=cache,target=${BUN_INSTALL_CACHE_DIR} \
--mount=type=cache,target=./node_modules,id=node_modules \
bun run bundle |
Beta Was this translation helpful? Give feedback.
Confirmed bug in Vite 8.0.6, fixed in 8.0.7.
PR #22151 added a
dns.getDefaultResultOrder()call, butdnsis aliased tonode:dns/promises. Node.js exposesgetDefaultResultOrderon both the top-level module and the promises namespace. Bun only implements it on the top-levelnode:dns, so the call throws.The fix in PR #22185 imports
getDefaultResultOrderdirectly fromnode:dnsinstead of going through promises. This runs during server options resolution, which Vite invokes even duringvite build, so it hits the build path too.npm install vite@8.0.7or pin 8.0.5 if you can't upgrade (the bug was only introduced in 8.0.6).