Sonarcloud using GithubAction kept failing on Javascript scanning

Hi there, I’m using Sonarcloud with github action and just encounter this problem recently. This is a javascript/typescript project.

Here’s the error log I’m encountering:

INFO: 8863/11647 files analyzed, current file: /github/workspace/packages/nodejs-web/src/shared/viewdesc/components/desktop/field/SelectField.js

ERROR: Failure during analysis, Node.js command to start eslint-bridge was: node --max-old-space-size=15000 /github/workspace/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 41795 127.0.0.1 /github/workspace/.scannerwork true false /github/workspace/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules17572401924537589765/package

java.lang.IllegalArgumentException: 37 is not a valid line offset for pointer. File packages/web-ui/desktop/shared/BookingModules/BookingModules.story.js has 12 character(s) at line 780

INFO: Sensor JavaScript analysis [javascript] (done) | time=587545ms

at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)

at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:337)

at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:270)

at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:286)

at org.sonar.plugins.javascript.eslint.EslintBridgeServer$Location.toTextRange(EslintBridgeServer.java:167)

at org.sonar.plugins.javascript.eslint.AnalysisProcessor.saveHighlights(AnalysisProcessor.java:152)

at org.sonar.plugins.javascript.eslint.AnalysisProcessor.processResponse(AnalysisProcessor.java:95)

at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyze(JavaScriptEslintBasedSensor.java:109)

at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.runEslintAnalysis(JavaScriptEslintBasedSensor.java:88)

at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyzeFiles(JavaScriptEslintBasedSensor.java:62)

at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:67)

at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)

at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:446)

at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:442)

at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:400)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:130)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)

at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)

at com.sun.proxy.$Proxy0.execute(Unknown Source)

at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)

at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)

at org.sonarsource.scanner.cli.Main.execute(Main.java:112)

at org.sonarsource.scanner.cli.Main.execute(Main.java:75)

at org.sonarsource.scanner.cli.Main.main(Main.java:61)

Here’s the sonar-project.properties that I’m using:


sonar.organization={redacted}

sonar.projectKey={redacted}

# relative paths to source directories. More details and properties are described

# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/

sonar.sources=.

sonar.javascript.node.maxspace=15000

for the github ci yml: I just copied it from the sonarcloud github action samples + adding a yarn install in it.

From what I have read, there’s a change in the file when the scanner is executed, but I don’t think there’s any change to the file since the file is static.

Hey there.

Can you share packages/web-ui/desktop/shared/BookingModules/BookingModules.story.js?

Hello Colin, is there any private sharing? I dont think I can’t share that in here.

I’ve flagged this thread for another team who will reach out to you via a private message for the file. Thanks for your patience.

Hello colin, I think the issue is fixed now, I realize some of the file has an abnormal line terminator. After fixing all the files the scanner now run smoothly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.