Getting ERROR webdriver: TypeError [ERR_INVALID_URL]: Invalid URL error

Hi Team,

I am getting ERROR webdriver: TypeError [ERR_INVALID_URL]: Invalid URL error, due to which it is failing to create a session. Can anyone help me with the same?

I am trying it on the iOS platform with WebdriverIo.

config.capabilities = [
{
// The defaults you need to have in your config
platformName: ‘ios’,
maxInstances: 1,
‘appium:deviceName’: ‘iPhone 15 Pro’,
‘appium:platformVersion’: ‘17.0’,
‘appium:automationName’: ‘XCUITest’,
// The path to the app
‘appium:app’: join(process.cwd(), ‘setup/mobile/src/apps/wdiodemoapp.app’),
// setup/mobile/src/apps/wdiodemoapp.app/wdiodemoapp
// @ts-ignore
‘appium:bundleId’: ‘org.reactjs.native.example.wdiodemoapp’,
‘appium:xcodeOrgId’:‘Alekhya Mamilla (Personal Team)’,
‘appium:xcodeSigningId’:‘Apple Development’,
‘appium:noReset’: false,
‘appium:newCommandTimeout’: 240,
},
];

server and port details
config.services = (config.services ? config.services : ).concat([
[
‘appium’,
{
// This will use the globally installed version of Appium
command: ‘appium’,
path : ‘/wd/hub/’,
args: {
// This is needed to tell Appium that we can execute local ADB commands
// and to automatically download the latest version of ChromeDriver
relaxedSecurity: true,
},
},
],
]);
//
// =====================
// Server Configurations
// =====================
//
config.port = 4723;

baseUrl: ‘http://localhost/wd/hub’,

What version of appium are you using? If you are using 2.x you don’t add the /wd/hub at the end of the url. If you are using 1.x I’d recommend upgrading to the latest version.

appium version: 2.5.4
i tried both ways, with and without /wd/hub, but it still showing the same error