Skip to content

Commit 334f76a

Browse files
manekinekkoCopilot
andauthored
Fix production build (#17)
- Import AzureAISearchVectorStore from the path that exists in the locked llamaindex version. The old path failed with "Module not found". - Add replicate as a direct dependency. llamaindex/next loads it at runtime as an external, and pnpm doesn't make it resolvable from the app otherwise. - Install from pnpm-lock.yaml in the Dockerfile. It copied a package-lock that doesn't exist, so the image ignored the lockfile and resolved newer versions that don't build. pnpm 9 is needed to read the lockfile format. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 32c631f commit 334f76a

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Use full image because we need node-gyp to build native dependencies
44
FROM node:20-alpine AS build
55

6-
RUN npm install -g pnpm@8.14.1 && \
6+
RUN npm install -g pnpm@9.15.9 && \
77
npm cache clean --force
88

99
WORKDIR /app
1010

11-
COPY package.json package-lock.* ./
12-
RUN pnpm install --ignore-scripts
11+
COPY package.json pnpm-lock.yaml ./
12+
RUN pnpm install --frozen-lockfile --ignore-scripts
1313
RUN pnpm add sharp
1414

1515
# Build the application

‎app/api/chat/engine/settings.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { OpenAI, OpenAIEmbedding, Settings } from "llamaindex";
1515
import {
1616
AzureAISearchVectorStore,
1717
IndexManagement,
18-
} from "llamaindex/vector-store/AzureAISearchVectorStore"
18+
} from "llamaindex/vector-store/azure/AzureAISearchVectorStore"
1919

2020
import { createSearchService } from "./createIndex";
2121

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"papaparse": "^5.4.1",
3636
"react": "^18.2.0",
3737
"react-dom": "^18.2.0",
38+
"replicate": "^1.0.1",
3839
"supports-color": "^8.1.1",
3940
"tailwind-merge": "^2.1.0",
4041
"tiktoken": "^1.0.15",

‎pnpm-lock.yaml‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)