JavaScript/TypeScript/CSS rules were not executed (bitbucket-pipeline + sonar cloud)

No matter how I config my bitbucket-pipelines.yml for my TypeScript project, i get the same warning on sonar cloud report. Would anyone provide some ideas or solutions please ?

Exact warning: JavaScript/TypeScript/CSS rules were not executed. Only Node.js v12.22 or later is supported, got 12.18.3.

below is my bitbucket-pipelines.yml

image: node:12
clone:
  depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
  caches:
    sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
  services:
    docker:
      memory: 2048
  steps:
    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        caches:
          - docker
          - node
          - sonar
        script:
          - cp .env.test .env
          - npm install
          - npm run test:coverage
          - pipe: sonarsource/sonarcloud-scan:1.2.1
            variables:
              EXTRA_ARGS: '-Dsonar.sources=src -Dsonar.tests=src -Dsonar.test.inclusions="src/**/*.spec.js,src/**/*.spec.jsx,src/**/*.test.js,src/**/*.test.jsx,src/**/*.test.ts,src/**/*.test.tsx" -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'

    - step: &check-quality-gate-sonarcloud
        name: Check the Quality Gate on SonarCloud
        script:
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.4

pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
  branches:
    master:
      - step: *build-test-sonarcloud
      - step: *check-quality-gate-sonarcloud
    develop:
      - step: *build-test-sonarcloud
      - step: *check-quality-gate-sonarcloud
  pull-requests:
    "**":
      - step: *build-test-sonarcloud
      - step: *check-quality-gate-sonarcloud

Hi,

Welcome to the community!

What did you make of that error?

 
Ann

I used the same “bitbucket-pipelines.yml”, which I used for previous JS project, on my TypeScript project. Then the warning occurs the Sonar cloud result is also compromised. Basically, I did nothing intentional to induce the warning (error).

I tried to change my “bitbucket-pipelines.yml” docker image to other version of nodeJS; but the result is the same. I want to resolve the problem but got not clue.

Hi,

It looks like this is about the version of Node.js that’s installed on your build agent. I would start by upgrading that.

 
HTH,
Ann

Hi OP. Were you able to find a resolution? I’m kind of in the same boat:

  1. Using sonarcloud and bitbucket cloud
  2. Getting warning in sonarcloud dashboard: “JavaScript/TypeScript/CSS rules were not executed. Only Node.js v12.22 or later is supported, got 12.18.3.”
  3. Build agent uses an image of Node version 16.11.1

I haven’t been able to make it go away nor to find a solution (or even an explanation of what exactly triggers this warning) on the Internet.

Some questions about it that are driving me crazy:

  1. I did not change anything in the code that would substantially cause this error
  2. Why would I receive an error like this coming from a managed service if I don’t manage its node version?

:exploding_head::exploding_head::exploding_head:

I think I figured it out - at least in my case what made the warning go away was to update the version of the sonarcloud pipe my project is using from 1.2.0 to 1.4.0

i.e.

pipe: sonarsource/sonarcloud-scan:1.4.0

in the bitbucket-pipelines.yml file

1 Like

Thanks for your input; in fact, I was able to reach the same conclusion days ago. For anyone who faced the same problem, the solution would be to update to the latest version.

If you ignore the warning, the report which generated with such warning would be completely useless and lack vital info.

1 Like