title: npm run build returns Module not found: Error: Can't resolve in my docker container in my NuxtJS app
body: <p>I've been on this issue for hours now. I kept receiving the error below when I run <code>npm run build</code> </p>
  
  <pre><code>ERROR in ./store/chatroom.js
  Module not found: Error: Can't resolve '@/services/ChatRoomService.js' in '/usr/src/app/store'
   @ ./store/chatroom.js 1:0-60 9:11-26
   @ ./.nuxt/store.js
   @ ./.nuxt/index.js
   @ ./.nuxt/client.js
   @ multi ./.nuxt/client.js
  </code></pre>
  
  <p>What's weird is, it is working perfectly on my local alone. The error aboves occur in my <code>docker build</code> and when I run my container with my codebase in it.. However, it is that weirder when I run my container with bind mount on my local and try <code>npm run build</code> it is working properly..</p>
  
  <p>At first I thought that maybe some files from my local are missing but I tried copying every file in my local to my container via <code>docker cp .</code> but it still does not work..</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM node:8.12.0
  
  WORKDIR /usr/src/app
  EXPOSE 3000
  
  COPY package.json package.json
  RUN npm install
  
  # To include everything
  COPY . .
  
  RUN npm run build
  
  ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
  
  </code></pre>
  
  <p><strong>chatroom.js</strong></p>
  
  <pre><code>import ChatRoomService from "@/services/ChatRoomService.js";
  export const state = () =&gt; ({});
  export const mutations = {};
  export const actions = {
    getText({ commit }, data) {
      return ChatRoomService.queryText(data).then(response =&gt; {
        if (response.code === 1) {
          commit("bbs/SET_TOP_ARR", JSON.parse(response.data.content), {
            root: true
          });
        }
      });
    }
  };
  
  </code></pre>
  
  <p><strong>chatRoomService.js</strong></p>
  
  <pre><code>import { mainApiClient, requestSetup } from "@/assets/js/axios.js";
  
  const apiModule = "chatroom";
  
  const resources = {
    chatroomGetChatRoomText: "text/queryText"
  };
  
  export default {
    queryText(body) {
      const resource = resources.chatroomGetChatRoomText;
      const [api, req] = requestSetup(resource, body, apiModule);
      return mainApiClient.post(api, req);
    }
  };
  
  </code></pre>