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

🧐[问题 | question] 使用docker 启动项目报错 #11417

Open
BestKai opened this issue Jan 4, 2025 · 0 comments
Open

🧐[问题 | question] 使用docker 启动项目报错 #11417

BestKai opened this issue Jan 4, 2025 · 0 comments

Comments

@BestKai
Copy link

BestKai commented Jan 4, 2025

🧐 问题描述 | Problem description

启动之后控制台报错

wait  - [Webpack] Compiling...
app-1  | error - Can not resolve dependence : '**/node_modules/@umijs/bundler-webpack/node_modules/react-error-overlay/lib/index.js', please install it
app-1  | error - AssertionError [ERR_ASSERTION]: dependence not found: **/node_modules/@umijs/bundler-webpack/node_modules/react-error-overlay/lib/index.js
app-1  |     at Dep.buildExposeContent (/app/node_modules/@umijs/mfsu/dist/dep/dep.js:90:31)
app-1  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
app-1  |     at async DepBuilder.writeMFFiles (/app/node_modules/@umijs/mfsu/dist/depBuilder/depBuilder.js:159:23)
app-1  |     at async DepBuilder.build (/app/node_modules/@umijs/mfsu/dist/depBuilder/depBuilder.js:137:7)
app-1  |     at async MFSU.buildDeps (/app/node_modules/@umijs/mfsu/dist/mfsu/mfsu.js:227:7) {
app-1  |   generatedMessage: false,
app-1  |   code: 'ERR_ASSERTION',
app-1  |   actual: null,
app-1  |   expected: true,
app-1  |   operator: '=='
app-1  | }

浏览器控制台报错

mf-va_remoteEntry.js:862 Uncaught (in promise) Error: Module ".//app/node_modules/@umijs/utils/compiled/strip-ansi/index.js" does not exist in container.
while loading ".//app/node_modules/@umijs/utils/compiled/strip-ansi/index.js" from webpack/container/reference/mf
    at mf-va_remoteEntry.js:862:11

💻 示例代码 | Sample code

使用官方Node.js镜像作为基础镜像

FROM node:20.18.1

WORKDIR /app



COPY package*.json ./



RUN npm install



COPY . .


RUN npm run build



EXPOSE 8000



CMD ["npm", "start"]

🚑 其他信息 | Other information

OS:

Node:

浏览器 | browser:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant