Getting error in K6 get method (Unexpected token)

I am new to load testing and I used the very basic example code from the K6 and getting following error.

This is the code :

import http from 'k6/http';
import { sleep } from 'k6';
export default function() {
  http.get('http://190.102.253.223:30500/30');
  sleep(1);

this is the error :

http.get(‘http://190.102.253.223:30500/30’);
5 | sleep(1);
6 |
| ^ at <internal/k6/compiler/lib/babel.min.js>:2:28542(109)

I want to send a parameter 30 in the GET method and it will return JSON output.

It works fine with curl

curl http://190.102.253.223:30500/30

What can I do to solve this issue
thank you in advance.

Hi @menukaperera,

Welcome to the community forums! :wave:

It seems that the bracket from the default function is missed.

The code below should work

import http from 'k6/http';
import { sleep } from 'k6';

export default function() {
  http.get('http://190.102.253.223:30500/30');

  sleep(1);
}

Let me know if that helps,
Cheers!