You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Not sure this is a but or rather some problem with my setup.
During the building of a docker image from my projet I get a Cannot read property 'quasar' of undefined error which I don't get while compiling the same problem on my dev PC. I've tried many things but can't figure out why there is different behavior during docker build. The package-lock.json files are identical.
Full error message
> vue-cli-service build
ERROR TypeError: Cannot read property 'quasar' of undefined
TypeError: Cannot read property 'quasar' of undefined
at module.exports (/tmp/build/apps/frontend/node_modules/vue-cli-plugin-quasar/index.js:13:29)
at /tmp/build/apps/frontend/node_modules/@vue/cli-service/lib/Service.js:78:7
at Array.forEach (<anonymous>)
at Service.init (/tmp/build/apps/frontend/node_modules/@vue/cli-service/lib/Service.js:76:18)
at Service.run (/tmp/build/apps/frontend/node_modules/@vue/cli-service/lib/Service.js:215:10)
at Object.<anonymous> (/tmp/build/apps/frontend/node_modules/@vue/cli-service/bin/vue-cli-service.js:36:9)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
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/2022-01-07T13_20_17_622Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Dockerfile
click to view file
ARG BUILD_DIR="/tmp/build"ARG AP="/usr/bruyland"#FROM node:16.13.1-alpine as baseFROM node:14 as baseFROM base AS builderARG BUILD_DIR WORKDIR ${BUILD_DIR}COPY ./apps/backend/*.json ./apps/backend/COPY ./apps/backend/src/ ./apps/backend/src/COPY ./apps/frontend/*.json ./apps/frontend/COPY ./apps/frontend/src/ ./apps/frontend/src/COPY ./apps/frontend/src/models/ ./apps/backend/src/models/WORKDIR ${BUILD_DIR}/apps/backendRUN npm set progress=falseRUN npm installRUN npm run buildWORKDIR ${BUILD_DIR}/apps/frontendRUN npm installRUN npm run buildFROM base as releaseRUN ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtimeARG BUILD_DIRARG COMMITARG TAGARG APRUN echo COMMIT=$COMMITRUN echo TAG=$TAGRUN echo AP=$APRUN echo BUILD_DIR=$BUILD_DIR/apps/backendWORKDIR ${AP}RUN echo COPYING BUILT APP FROM BUILDER CONTAINERCOPY --from=builder ${BUILD_DIR}/package.json ${AP}COPY --from=builder ${BUILD_DIR}/package-lock.json ${AP}COPY --from=builder ${BUILD_DIR}/dist/ ${AP}RUN npm install --only=production --no-optionalENV PORT=3000ENV NODE_ENV=productionENV COMMIT=$COMMITENV TAG=$TAGEXPOSE ${PORT}RUN mkdir -p logs && chown 1000 logs && chgrp 1000 logs && chmod -R o+w logsVOLUME ["${AP}/logs", "${AP}/config"]USER nodeCMD [ "node", "dist/main" ]
this is on node version 16.3.0. The loadFileConfig calls loadModule which calls createRequire which is this
const createRequire = Module.createRequire || Module.createRequireFromPath || function (filename) {
and at least on node 16 it seems to be using the built in createRequire. However the file name that is passed in is the package.json file.
So basically it never actually tries to load the vue.config.js file.
From debug statements put in loadFileConfig and loadModule... vue:loadFileConfig-fileConfig D:\programming\test\test4\vue.config.js +0ms vue:loadFileConfig-fileConfig D:\programming\test\test4\vue.config.js +0ms vue:loadFileConfig-esm false +0ms vue:loadModule-request1 D:\programming\test\test4\vue.config.js +0ms vue:loadModule-fileName D:\programming\test\test4\package.json +0ms vue:loadModule-createRequire [Function: createRequire] +0ms vue:loadModule-createRequire.results { transpileDependencies: true } +0ms
The request value has the correct file name, but its never actually loaded as all it tries to load is the package.json!
Describe the bug
Not sure this is a but or rather some problem with my setup.
During the building of a docker image from my projet I get a
Cannot read property 'quasar' of undefined
error which I don't get while compiling the same problem on my dev PC. I've tried many things but can't figure out why there is different behavior during docker build. Thepackage-lock.json
files are identical.Full error message
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Dockerfile
click to view file
Additional context
package.json file
click to view file
vue.config.js
click to view file
File that causes the error in the container
click to view file
The text was updated successfully, but these errors were encountered: