简体   繁体   English

Docker/Next js:: 找不到模块“@mui/x-date-pickers/AdapterDateFns”或其相应的类型声明

[英]Docker/Next js :: Cannot find module '@mui/x-date-pickers/AdapterDateFns' or its corresponding type declarations

When I build my application via npm run build , my next js app builds it successfully.当我通过npm run build构建我的应用程序时,我的下一个 js 应用程序成功构建了它。 There is no issue.没有问题。

But when I build this in my docker file, I get This issue但是当我在我的 docker 文件中构建它时,我得到了这个问题

#0 12.18 Type error: Cannot find module '@mui/x-date-pickers/AdapterDateFns' or its corresponding type declarations.
#0 12.18
#0 12.18   4 | import useupdateManifest from 'src/hooks/manifest/useUpdateManifest';
#0 12.18   5 | import { manifests } from 'src/types/manifest/manifests';
#0 12.18 > 6 | import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
#0 12.18     |                                ^
#0 12.18   7 | import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
#0 12.18   8 | import { MobileDatePicker } from '@mui/x-date-pickers/MobileDatePicker';#0 12.18   9 | import { branchVehicleStoreVar } from 'src/Store/branchVehicleStore';
------
failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1

This is my package.json files dependencie list这是我的package.json文件依赖列表

"dependencies": {
    "@apollo/client": "^3.5.8",
    "@david.kucsai/react-pdf-table": "^0.4.1",
    "@emotion/react": "^11.7.1",
    "@emotion/styled": "^11.6.0",
    "@hookform/resolvers": "^2.8.8",
    "@material-ui/core": "^4.12.4",
    "@mui/icons-material": "^5.4.1",
    "@mui/lab": "^5.0.0-alpha.78",
    "@mui/material": "^5.4.1",
    "@react-md/autocomplete": "^5.1.2",
    "@react-pdf/renderer": "^2.1.1",
    "@tabler/icons": "^1.54.0",
    "@types/lodash": "^4.14.178",
    "date-fns": "^2.28.0",
    "deepmerge": "^4.2.2",
    "formik": "^2.2.9",
    "framer-motion": "^6.2.8",
    "graphql": "^16.3.0",
    "lodash": "^4.17.21",
    "material-ui-popup-state": "^2.0.0",
    "moment": "^2.29.2",
    "next": "12.0.10",
    "notistack": "^2.0.3",
    "print-js": "^1.6.0",
    "prop-types": "^15.8.1",
    "react": "17.0.2",
    "react-device-detect": "^2.1.2",
    "react-dom": "17.0.2",
    "react-hook-form": "^7.27.0",
    "react-infinite-scroll-component": "^6.1.0",
    "react-md": "^5.1.2",
    "react-perfect-scrollbar": "^1.5.8",
    "yup": "^0.32.11"
  },

Please help me.请帮我。 Thank you.谢谢你。

Dockerfile文件

# get the base node image
FROM node:alpine

# set the working dir for container
WORKDIR /app

# copy the json file first
COPY ./package.json .

# install npm dependencies
RUN npm install --force

# copy other project files
COPY . .

RUN npm run build

# Exposse port number
EXPOSE 8101

# build the folder
CMD ["npm", "run", "start" ]

docker-compose file docker-compose 文件

version: '3.8'
services: 
    frontend:
        build: .
        container_name: next_c
        ports: 
          - '8101:8101'
        stdin_open: true
        tty: true

.dockerignore file .dockerignore 文件

/.next/
/node_modules

It seems you don't have @mui/x-date-pickers in the dependency list.似乎您的依赖列表中没有 @mui/x-date-pickers 。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 vercel 上部署我的 next.js 项目,找不到模块“react-icons/Fa”或其相应的类型声明 - deploy my next.js project on vercel, Cannot find module 'react-icons/Fa' or its corresponding type declarations 找不到模块“graphql-hooks”或其相应的类型声明 - Cannot find module 'graphql-hooks' or its corresponding type declarations 找不到模块“./App.svelte”或其对应的类型声明 - Cannot find module './App.svelte' or its corresponding type declarations 如何解决找不到找不到模块'../home/featuredRooms'或其对应的类型声明。? - how to solve cannot find Cannot find module '../home/featuredRooms' or its corresponding type declarations.? React,Storybook - TS2307:找不到模块“按钮”或其相应的类型声明 CAN SB RESOLVE? - React,Storybook - TS2307: Cannot find module 'Button' or its corresponding type declarations CAN SB RESOLVE? 找不到模块“@react-navigation/native”或其相应的类型声明 - Cannot find module '@react-navigation/native' or its corresponding type declarations 为什么我收到此错误找不到模块“nestjs/common”或其相应的类型声明 - Why I got this error Cannot find module 'nestjs/common' or its corresponding type declarations VueJS/Typescript - 找不到模块“./components/Navigation”或其相应的类型声明 - VueJS/Typescript - Cannot find module './components/Navigation' or its corresponding type declarations ReScript,TypeScript:找不到模块“@rescript/react/src/ReactDOM.gen”或其相应的类型声明 - ReScript, TypeScript: Cannot find module '@rescript/react/src/ReactDOM.gen' or its corresponding type declarations 在 Angular 项目中尝试导入 SDK 时找不到模块或其对应的类型声明 - Can't find module or its corresponding type declarations when trying to import SDK in Angular Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM