# Need help solving this error

**URL:** <https://community.haxe.org/t/need-help-solving-this-error/3851>\
**Category:** Haxe\
**Created:** [February 7, 2023, 4:53pm UTC](https://community.haxe.org/t/need-help-solving-this-error/3851 "2023-02-07T16:53:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Confidant](https://community.haxe.org/user_avatar/community.haxe.org/confidant/32/63_2.png) [@Confidant](https://community.haxe.org/u/Confidant)\
**Post date:** [February 7, 2023, 4:53pm UTC](https://community.haxe.org/t/need-help-solving-this-error/3851/1 "2023-02-07T16:53:04Z")

</div>

Hi all,  
I have this supposedly simple function:

```haxe
function getBaseUrl(host:String, ?forwardedHost:String):Sting{
	final host = forwardedHost == null ? host : forwardedHost;
	final scheme = host.startsWith('localhost') ? 'http' : 'https';
	final baseUrl = '$scheme://$host';
	return cast(baseUrl);
}

```

Problem is I only get this output:  
 ![12345](https://community.haxe.org/uploads/default/original/2X/1/10e28cb0b9620e459ece5f1fd81cf02a28aadef5.jpeg)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Kallekro](https://community.haxe.org/user_avatar/community.haxe.org/kallekro/32/1989_2.png) [@Kallekro](https://community.haxe.org/u/Kallekro)\
**Post date:** [February 8, 2023, 12:13pm UTC](https://community.haxe.org/t/need-help-solving-this-error/3851/2 "2023-02-08T12:13:44Z")

</div>

I seem to have a similar problem. Can the devs do something?

```haxe
    function parseDefines(args : Array<String>):Array<Sting> {
        var done = false;
        final defines = [];
        while (!done) {
            if (args[0].startsWith("-D")) {
                defines.push(args.splice(0, 1)[0].substr(2));
                done = args.length == 0;
            } else {
                done = true;
            }
        }
        return cast(defines);
    }

```

Outputs this:

 ![stingarray](https://community.haxe.org/uploads/default/original/2X/0/0dd9d51a9de327319ca08a19548b612b8b199c35.png)

---

<div class="post-metadata">

**Author:** ![Confidant](https://community.haxe.org/user_avatar/community.haxe.org/confidant/32/63_2.png) [@Confidant](https://community.haxe.org/u/Confidant)\
**Post date:** [February 8, 2023, 3:53pm UTC](https://community.haxe.org/t/need-help-solving-this-error/3851/3 "2023-02-08T15:53:03Z")

</div>

Clearly something is fishy here. I will report this to the Police in the meantime.
