full-stack-fastapi-template
full-stack-fastapi-template copied to clipboard
ERROR: Service 'frontend' failed to build, when executing `docker-compose up -d`
Error when executing docker-compose up -d
. . .
Step 9/13 : RUN npm run build
---> Running in d7c0f6e642bd
> [email protected] build /app
> vue-cli-service build
- Building for production...
ERROR Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5'
Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at api.chainWebpack.config (/app/node_modules/@vue/cli-plugin-typescript/index.js:106:16)
at webpackChainFns.forEach.fn (/app/node_modules/@vue/cli-service/lib/Service.js:236:40)
at Array.forEach (<anonymous>)
at Service.resolveChainableWebpackConfig (/app/node_modules/@vue/cli-service/lib/Service.js:236:26)
at PluginAPI.resolveChainableWebpackConfig (/app/node_modules/@vue/cli-service/lib/PluginAPI.js:145:25)
at module.exports (/app/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:9:22)
at build (/app/node_modules/@vue/cli-service/lib/commands/build/index.js:147:50)
at api.registerCommand (/app/node_modules/@vue/cli-service/lib/commands/build/index.js:89:13)
at Service.run (/app/node_modules/@vue/cli-service/lib/Service.js:230:12)
at Object.<anonymous> (/app/node_modules/@vue/cli-service/bin/vue-cli-service.js:36:9)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-03-27T23_02_59_539Z-debug.log
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1
The same
Setting the following versions in frontend/package.json
solved it for me:
"@vue/cli-plugin-typescript": "~4.1.0",
"@vue/cli-plugin-unit-jest": "~4.1.0",
but now I'm running into other frontend problems related to TypeScript compilation
Yeah, it's a problem with dependencies being updated to version, which are too new. With the following (note ~
instead of ^
before version numbers to allow only minor updates) the frontend builds now:
"dependencies": {
"@babel/polyfill": "^7.2.5",
"axios": "^0.18.0",
"core-js": "^3.4.3",
"register-service-worker": "^1.0.0",
"typesafe-vuex": "~3.1.1",
"vee-validate": "~2.1.7",
"vue": "~2.5.22",
"vue-class-component": "~6.0.0",
"vue-property-decorator": "~7.3.0",
"vue-router": "~3.0.2",
"vuetify": "~1.4.4",
"vuex": "~3.1.0"
},
"devDependencies": {
"@types/jest": "~23.3.13",
"@vue/cli-plugin-babel": "~4.1.1",
"@vue/cli-plugin-pwa": "~4.1.1",
"@vue/cli-plugin-typescript": "~4.1.0",
"@vue/cli-plugin-unit-jest": "~4.1.0",
"@vue/cli-service": "~4.1.1",
"@vue/test-utils": "~1.0.0-beta.28",
"babel-core": "7.0.0-bridge.0",
"ts-jest": "~23.10.5",
"typescript": "~3.2.4",
"vue-cli-plugin-vuetify": "~2.0.2",
"vue-template-compiler": "~2.5.22"
},
Error when executing
docker-compose up -d
. . . Step 9/13 : RUN npm run build ---> Running in d7c0f6e642bd > [email protected] build /app > vue-cli-service build - Building for production... ERROR Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5' Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at api.chainWebpack.config (/app/node_modules/@vue/cli-plugin-typescript/index.js:106:16) at webpackChainFns.forEach.fn (/app/node_modules/@vue/cli-service/lib/Service.js:236:40) at Array.forEach (<anonymous>) at Service.resolveChainableWebpackConfig (/app/node_modules/@vue/cli-service/lib/Service.js:236:26) at PluginAPI.resolveChainableWebpackConfig (/app/node_modules/@vue/cli-service/lib/PluginAPI.js:145:25) at module.exports (/app/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:9:22) at build (/app/node_modules/@vue/cli-service/lib/commands/build/index.js:147:50) at api.registerCommand (/app/node_modules/@vue/cli-service/lib/commands/build/index.js:89:13) at Service.run (/app/node_modules/@vue/cli-service/lib/Service.js:230:12) at Object.<anonymous> (/app/node_modules/@vue/cli-service/bin/vue-cli-service.js:36:9) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build: `vue-cli-service build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-03-27T23_02_59_539Z-debug.log ERROR: Service 'frontend' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1
This issue has been addressed by #471 here is the solution: https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/471