SOLVED: Failed to load config from /app/vite.config.ts

After a recent git pull, I get this:

(base) ➜  bolt.diy git:(stable) ✗ npm run dockerbuild                             

> bolt@0.0.6 dockerbuild
> docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-development .

[+] Building 0.5s (11/11) FINISHED                                              docker:default
 => [internal] load build definition from Dockerfile                                      0.0s
 => => transferring dockerfile: 2.69kB                                                    0.0s
 => [internal] load metadata for docker.io/library/node:20.18.0                           0.5s
 => [internal] load .dockerignore                                                         0.0s
 => => transferring context: 427B                                                         0.0s
 => [base 1/5] FROM docker.io/library/node:20.18.0@sha256:a7a3b7ec6de4b11bb2d673b31de9d2  0.0s
 => [internal] load build context                                                         0.0s
 => => transferring context: 15.06kB                                                      0.0s
 => CACHED [base 2/5] WORKDIR /app                                                        0.0s
 => CACHED [base 3/5] COPY package.json pnpm-lock.yaml ./                                 0.0s
 => CACHED [base 4/5] RUN corepack enable pnpm && pnpm install                            0.0s
 => CACHED [base 5/5] COPY . .                                                            0.0s
 => CACHED [bolt-ai-development 1/1] RUN mkdir -p ${WORKDIR}/run                          0.0s
 => exporting to image                                                                    0.0s
 => => exporting layers                                                                   0.0s
 => => writing image sha256:d7cbdc9575020a0d4669bf8395ced46a9bd1cfc2fbfb9bf2f070ba5bdfdf  0.0s
 => => naming to docker.io/library/bolt-ai:development                                    0.0s
 => => naming to docker.io/library/bolt-ai:latest                                         0.0s
(base) ➜  bolt.diy git:(stable) ✗ docker compose --profile development up
WARN[0000] The "GROQ_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "HuggingFace_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ANTHROPIC_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPEN_ROUTER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GOOGLE_GENERATIVE_AI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OLLAMA_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "XAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AWS_BEDROCK_CONFIG" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GROQ_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "HuggingFace_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ANTHROPIC_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPEN_ROUTER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "XAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GOOGLE_GENERATIVE_AI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OLLAMA_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AWS_BEDROCK_CONFIG" variable is not set. Defaulting to a blank string. 
[+] Running 1/0
 ✔ Container boltdiy-app-dev-1  Created                                                   0.0s 
Attaching to app-dev-1
app-dev-1  | 
app-dev-1  | > bolt@0.0.6 dev /app
app-dev-1  | > node pre-start.cjs  && remix vite:dev "--host" "0.0.0.0"
app-dev-1  | 
app-dev-1  | fatal: detected dubious ownership in repository at '/app'
app-dev-1  | To add an exception for this directory, call:
app-dev-1  | 
app-dev-1  |    git config --global --add safe.directory /app
app-dev-1  | 
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  |           B O L T . D I Y
app-dev-1  |          ⚡️  Welcome  ⚡️
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  | 
app-dev-1  | 📍 Current Version Tag: v"0.0.6"
app-dev-1  | 📍 Current Commit Version: "no-git-info"
app-dev-1  |   Please wait until the URL appears here
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  | failed to load config from /app/vite.config.ts
app-dev-1  | Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'dotenv' imported from /app/vite.config.ts.timestamp-1738120801233-b5b9c6ebbd6a3.mjs
app-dev-1  | Did you mean to import "dotenv/lib/main.js"?
app-dev-1  |     at packageResolve (node:internal/modules/esm/resolve:854:9)
app-dev-1  |     at moduleResolve (node:internal/modules/esm/resolve:927:18)
app-dev-1  |     at defaultResolve (node:internal/modules/esm/resolve:1169:11)
app-dev-1  |     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
app-dev-1  |     at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
app-dev-1  |     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
app-dev-1  |     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
app-dev-1  |     at link (node:internal/modules/esm/module_job:95:36) {
app-dev-1  |   code: 'ERR_MODULE_NOT_FOUND'
app-dev-1  | }
app-dev-1  |  ELIFECYCLE  Command failed with exit code 1.
app-dev-1 exited with code 1

It seems like maybe a user ownership has changed inside of the app, the directory ./app has not been touched by me. But notice it compains about /app which is inside the container.

@uberthoth pls try the main branch. There was fix 5 days ago for docker env. Let me know if it fix this error.

1 Like

pretty much the same behavior after a switch to main and a rebuild:

(base) ➜  bolt.diy git:(main) ✗ npm run dockerbuild                    

> bolt@0.0.6 dockerbuild
> docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-development .

[+] Building 11.1s (11/11) FINISHED                                                                                                                                             docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                      0.0s
 => => transferring dockerfile: 2.69kB                                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/node:20.18.0                                                                                                                           0.5s
 => [internal] load .dockerignore                                                                                                                                                         0.0s
 => => transferring context: 427B                                                                                                                                                         0.0s
 => [base 1/5] FROM docker.io/library/node:20.18.0@sha256:a7a3b7ec6de4b11bb2d673b31de9d28c6da09c557ee65453672c8e4f754c23fc                                                                0.0s
 => [internal] load build context                                                                                                                                                         0.0s
 => => transferring context: 594.90kB                                                                                                                                                     0.0s
 => CACHED [base 2/5] WORKDIR /app                                                                                                                                                        0.0s
 => [base 3/5] COPY package.json pnpm-lock.yaml ./                                                                                                                                        0.0s
 => [base 4/5] RUN corepack enable pnpm && pnpm install                                                                                                                                   5.7s
 => [base 5/5] COPY . .                                                                                                                                                                   0.0s 
 => [bolt-ai-development 1/1] RUN mkdir -p ${WORKDIR}/run                                                                                                                                 0.1s 
 => exporting to image                                                                                                                                                                    4.7s 
 => => exporting layers                                                                                                                                                                   4.6s 
 => => writing image sha256:c874b54b61cf21bb0a7b23ca09e9702d4fc92e5810ca0baa6fe03bdbf1c63728                                                                                              0.0s 
 => => naming to docker.io/library/bolt-ai:development                                                                                                                                    0.0s 
 => => naming to docker.io/library/bolt-ai:latest                                                                                                                                         0.0s
(base) ➜  bolt.diy git:(main) ✗ docker compose --profile development up
WARN[0000] The "GROQ_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "HuggingFace_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ANTHROPIC_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPEN_ROUTER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GOOGLE_GENERATIVE_AI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OLLAMA_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "XAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AWS_BEDROCK_CONFIG" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GROQ_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "HuggingFace_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPENAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "ANTHROPIC_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPEN_ROUTER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "XAI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "GOOGLE_GENERATIVE_AI_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OLLAMA_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_KEY" variable is not set. Defaulting to a blank string. 
WARN[0000] The "TOGETHER_API_BASE_URL" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AWS_BEDROCK_CONFIG" variable is not set. Defaulting to a blank string. 
[+] Running 1/0
 ✔ Container boltdiy-app-dev-1  Recreated                                                                                                                                                 0.0s 
Attaching to app-dev-1
app-dev-1  | 
app-dev-1  | > bolt@0.0.6 dev /app
app-dev-1  | > node pre-start.cjs  && remix vite:dev "--host" "0.0.0.0"
app-dev-1  | 
app-dev-1  | fatal: detected dubious ownership in repository at '/app'
app-dev-1  | To add an exception for this directory, call:
app-dev-1  | 
app-dev-1  |    git config --global --add safe.directory /app
app-dev-1  | 
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  |           B O L T . D I Y
app-dev-1  |          ⚡️  Welcome  ⚡️
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  | 
app-dev-1  | 📍 Current Version Tag: v"0.0.6"
app-dev-1  | 📍 Current Commit Version: "no-git-info"
app-dev-1  |   Please wait until the URL appears here
app-dev-1  | ★═══════════════════════════════════════★
app-dev-1  | failed to load config from /app/vite.config.ts
app-dev-1  | Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'dotenv' imported from /app/vite.config.ts.timestamp-1738163858779-0b202ec2f04c5.mjs
app-dev-1  | Did you mean to import "dotenv/lib/main.js"?
app-dev-1  |     at packageResolve (node:internal/modules/esm/resolve:854:9)
app-dev-1  |     at moduleResolve (node:internal/modules/esm/resolve:927:18)
app-dev-1  |     at defaultResolve (node:internal/modules/esm/resolve:1169:11)
app-dev-1  |     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
app-dev-1  |     at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
app-dev-1  |     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
app-dev-1  |     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
app-dev-1  |     at link (node:internal/modules/esm/module_job:95:36) {
app-dev-1  |   code: 'ERR_MODULE_NOT_FOUND'
app-dev-1  | }
app-dev-1  |  ELIFECYCLE  Command failed with exit code 1.
app-dev-1 exited with code 1

btw my .env.local is as follows:

# You only need this environment variable set if you want to use oLLAMA models
# EXAMPLE http://localhost:11434
OLLAMA_API_BASE_URL=http://10.64.201.1:11434
# Example Context Values for qwen2.5-coder:32b
# 
# DEFAULT_NUM_CTX=32768 # Consumes 36GB of VRAM
# DEFAULT_NUM_CTX=24576 # Consumes 32GB of VRAM
# DEFAULT_NUM_CTX=12288 # Consumes 26GB of VRAM
# DEFAULT_NUM_CTX=6144 # Consumes 24GB of VRAM
DEFAULT_NUM_CTX=32768

just comment these two lines and try again
image

file name vite.config.ts

That did work. TYVM!

of note I also needed to exec inside the container and run

git config --global --add safe.directory /app

1 Like