This is the error that occurred upon running my build:
WARNING in configuration
#12 0.535 The 'mode' option has not been set, webpack will fallback to 'production' for this value.
#12 0.535 Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
#12 0.535 You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
#12 0.535
#12 0.535 ERROR in main
#12 0.535 Module not found: Error: Can't resolve './src' in '/src'
#12 0.535 resolve './src' in '/src'
#12 0.535 using description file: /src/package.json (relative path: .)
#12 0.535 Field 'browser' doesn't contain a valid alias configuration
#12 0.535 using description file: /src/package.json (relative path: ./src)
#12 0.535 no extension
#12 0.535 Field 'browser' doesn't contain a valid alias configuration
#12 0.535 /src/src doesn't exist
#12 0.535 .js
#12 0.535 Field 'browser' doesn't contain a valid alias configuration
#12 0.535 /src/src.js doesn't exist
#12 0.535 .json
#12 0.535 Field 'browser' doesn't contain a valid alias configuration
#12 0.535 /src/src.json doesn't exist
#12 0.535 .wasm
#12 0.535 Field 'browser' doesn't contain a valid alias configuration
#12 0.535 /src/src.wasm doesn't exist
#12 0.535 as directory
#12 0.535 /src/src doesn't exist
This is my Dockerfile:
FROM node:12.10
WORKDIR /src
COPY package.json package.json
COPY yarn.lock yarn.lock
#Note the dependency install
RUN apt-get update && \
apt-get -y install libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev
RUN yarn install
RUN yarn run build
EXPOSE 3000
COPY . .
CMD ["node", "./server"]
You can find a copy of my webpack.config.js here.
I'm not sure if my webpack configuration is correct or if the source of the error lies in my Dockerfile. I look forward to your insight. Any help is greatly appreciated, thank you.