No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to build a quasar app with docker?

    Framework
    2
    3
    1950
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Anatolii last edited by

      System: Windows 10 (19042.804)
      Quasar version: 1.15.3
      Docker version: 3.1.0 (51484)

      Dockerfile

      FROM node:13.14-alpine as develop-stage
      WORKDIR /app
      COPY package*.json ./
      RUN yarn global add @quasar/cli \
          && npm i -g eslint
      COPY . .
      
      
      # build stage
      FROM develop-stage as build-stage
      RUN yarn \
          && yarn lint \
          && quasar build
      
      
      # production stage
      FROM nginx:1.17.5-alpine as production-stage
      COPY --from=build-stage /app/dist/spa /usr/share/nginx/html
      EXPOSE 80
      CMD ["nginx", "-g", "daemon off;"]
      

      Build throws next error:

      #13 111.2 Module not found: Error: Can't resolve 'src/pages' in '/app/src/router'
      #13 111.2 resolve 'src/pages' in '/app/src/router'
      #13 111.2   Parsed request is a module
      #13 111.2   using description file: /app/package.json (relative path: ./src/router)
      #13 111.2     aliased with mapping 'src': '/app/src' to '/app/src/pages'
      #13 111.2       using description file: /app/package.json (relative path: ./src/router)
      #13 111.2         Field 'browser' doesn't contain a valid alias configuration
      #13 111.2         using description file: /app/package.json (relative path: ./src/pages)
      #13 111.2           no extension
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages is not a file
      #13 111.2           .mjs
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages.mjs doesn't exist
      #13 111.2           .js
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages.js doesn't exist
      #13 111.2           .vue
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages.vue doesn't exist
      #13 111.2           .json
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages.json doesn't exist
      #13 111.2           .wasm
      #13 111.2             Field 'browser' doesn't contain a valid alias configuration
      #13 111.2             /app/src/pages.wasm doesn't exist
      #13 111.2           as directory
      #13 111.2             existing directory
      #13 111.2               using path: /app/src/pages/index
      #13 111.2                 using description file: /app/package.json (relative path: ./src/pages/index)
      #13 111.2                   no extension
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index doesn't exist
      #13 111.2                   .mjs
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index.mjs doesn't exist
      #13 111.2                   .js
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index.js doesn't exist
      #13 111.2                   .vue
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index.vue doesn't exist
      #13 111.2                   .json
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index.json doesn't exist
      #13 111.2                   .wasm
      #13 111.2                     Field 'browser' doesn't contain a valid alias configuration
      #13 111.2                     /app/src/pages/index.wasm doesn't exist
      

      I found this topic and maybe it’s the same issue, but there is no answer.
      Quasar build fails

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @Anatolii last edited by

        @anatolii

        I found this topic and maybe it’s the same issue, but there is no answer.

        Well there’s sort of an answer, use Linux not Windows:

        When I create the project directly on the linux box: quasar build: OK.

        A 1 Reply Last reply Reply Quote 0
        • A
          Anatolii @dobbel last edited by

          @dobbel It’s not a solution, but thanks for the answer.
          I found the issue, it was the wrong import path of the component in routes. Component name Index.vue was imported without extension .vue and it created an error.
          But strange that quasar dev works without any errors

          1 Reply Last reply Reply Quote 1
          • First post
            Last post