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

    unexpected console statement errors in production build pwa after recent update

    Framework
    4
    12
    1088
    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.
    • Kentskyo
      Kentskyo last edited by

      I updated quasar and npm dependencies to latest revision and now I’m receiving this error when trying to build a pwa:

      quasar build -m pwa

      ERROR in ./src-pwa/register-service-worker.js
      Module Error (from ./node_modules/eslint-loader/index.js):

      C:\Data\projects\rattler\src-pwa\register-service-worker.js
      16:5 error Unexpected console statement no-console
      20:5 error Unexpected console statement no-console
      24:5 error Unexpected console statement no-console
      28:5 error Unexpected console statement no-console
      32:5 error Unexpected console statement no-console
      36:5 error Unexpected console statement no-console
      42:5 error Unexpected console statement no-console

      ✖ 7 problems (7 errors, 0 warnings)

      @ ./.quasar/client-entry.js 101:0-48
      @ multi ./.quasar/client-entry.js

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        How did you update quasar?

        Scott

        1 Reply Last reply Reply Quote 0
        • Kentskyo
          Kentskyo last edited by Kentskyo

          npm update

          in the project directory…
          I manually commented out all the console statements in src-pwa/register-service-worker.js to circumvent

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Could you please run quasar upgrade and copy the info that it says here?

            Scott

            1 Reply Last reply Reply Quote 0
            • Kentskyo
              Kentskyo last edited by

              Sure…

              C:\Data\projects\rattler>quasar upgrade
              Quasar CLI · Gathering information with npm…
              Congrats! All Quasar packages are up to date.
              C:\Data\projects\rattler>

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by

                If you could, please try installing yarn, removing any .lock files along with the node_modules folder and then running yarn install.

                We highly recommend using Yarn for local package mangement, as Yarn has proven to be much more stable for Quasar than npm.

                Scott

                1 Reply Last reply Reply Quote 0
                • Kentskyo
                  Kentskyo last edited by

                  Thanks Scott. I don’t like yarn. The problem appears to have been a file checked into the release with console statements that was part of the production build. I’m not sure yarn would have made a difference. Would it?

                  1 Reply Last reply Reply Quote 0
                  • s.molinari
                    s.molinari last edited by

                    Possibly. Not sure. What’s not to like about Yarn?

                    Scott

                    1 Reply Last reply Reply Quote 0
                    • metalsadman
                      metalsadman last edited by

                      If youre on a windows os, then you should use yarn, npm having issues with local deps. Anywhoo, try to comment the bottom settings about console logs in your .eslintrc file. @Kentskyo

                      1 Reply Last reply Reply Quote 0
                      • Kentskyo
                        Kentskyo last edited by

                        I’m in the “if it’s not broke don’t fix it” mode for package managers, I haven’t run into any specific problems with npm on quasar thus far. If there are issues, I would hope they would be documented in the install page. Likewise if there’s a sunset date for npm being supported. I prefer not to disable the warnings in .eslintrc, they seem useful for flagging issues like this and I’d like to be aware of them when they happen

                        1 Reply Last reply Reply Quote 0
                        • A
                          Arto last edited by Arto

                          NPM works just fine. No need to create FUD.
                          This behaviour seems expected. Linter is checking register-service-worker.js and has a no-console rule for production environment.
                          You can solve it by any of these (and probably other) means:

                          • removing the logs
                          • disabling linter for that file (or only disable this specific rule)
                          • allowing all logs in production
                          • changing no-console severity to warn instead of error
                          • not linting during build
                            …
                            profit?
                          1 Reply Last reply Reply Quote 0
                          • metalsadman
                            metalsadman last edited by metalsadman

                            @Arto we’re not advocating yarn or fud, we just have many past reports that yarn solved somehow on windows platform. If npm works for you, then do use it (we useit too) :).

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