# Need help with TS build

**URL:** <https://forum.babylonjs.com/t/need-help-with-ts-build/1546>\
**Category:** Questions\
**Created:** [February 22, 2019, 2:52am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546 "2019-02-22T02:52:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 22, 2019, 2:52am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/1 "2019-02-22T02:52:37Z")

</div>

**UPDATE**  
I had to get rid of a single whitespace that was in the wrong place according to the compiler! That might have fixed it. Gotta get in the habit of reading the CLI \>\_\<…

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 22, 2019, 3:18am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/2 "2019-02-22T03:18:01Z")

</div>

_found the answer to this question_

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 22, 2019, 4:16pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/3 "2019-02-22T16:16:15Z")

</div>

" Edit Code

Once the test task (gulp run) has been launched, any saved changes in the Typescript or shader files will automatically rebuild the associated Javascript files. Simply refresh your browser to see the changes in effect and begin to debug your new code.

_Hint_ : You may need to refresh the code before adding back a new breakpoint."

for some reason this seems to not be working when I make changes to the new ts file I added…  
I must be missing a simple step.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 22, 2019, 4:27pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/4 "2019-02-22T16:27:43Z")

</div>

if it is a new file created AFTER launching gulp run you need to restart it so it will see that new file

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 22, 2019, 4:43pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/5 "2019-02-22T16:43:17Z")

</div>

I did all that, and for some reason its not exposing the new method in any of the build files that I see?

🙂 as soon as I figure this out, Ill send over the PR for the STL exporter!

@Deltakosh, the really odd thing is when I launch the playground on my local environment after a build, and I start trying to use the method it will code complete for me and act like its a method, but then as soon as I try to call it, it says that method does not exist.

I looked at the [http://localhost:1338/.temp/localDevUMD/serializers/babylonjs.serializers.js](http://localhost:1338/.temp/localDevUMD/serializers/babylonjs.serializers.js)  
and it seems that the function is there… It just does not ever seem to be under the BABYLON.STLExport scope in reality.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 22, 2019, 4:44pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/6 "2019-02-22T16:44:32Z")

</div>

Start a PR so I can see what could be wrong

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [February 23, 2019, 12:11am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/7 "2019-02-23T00:11:27Z")

</div>

The exporters are in a separate repo, can you just use `npm link` or `yarn link` to bring your latest into main repo live coding?

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 23, 2019, 6:03am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/8 "2019-02-23T06:03:03Z")

</div>

Ill look up npm link. thank you!

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 23, 2019, 7:47am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/9 "2019-02-23T07:47:40Z")

</div>

So I am still under the impression my addition did not work and am kinda confused. The code prediction comes up and gives all the correct information, but if you look at the console output here it says these things do not exist.

 ![does_not_work](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/1X/f91bd71231afbd988daaf7fc8fc8252a38fe0060.jpeg)

The live playground is doing just like my localhost was doing. Ill check again in the morning, but I doubt I don’t see any reason for it to start working.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 23, 2019, 4:18pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/10 "2019-02-23T16:18:45Z")

</div>

I checked again this morning to make sure that it did not build after I went to bed.

Looks like it does not exist as a method under the BJS scope at all, but the auto fill on the code hinting works, so something partially worked?

@brianzinn Is that something that I fix with npm link?

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [February 24, 2019, 2:25am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/11 "2019-02-24T02:25:38Z")

</div>

> [@Pryme8](#):
>
> @brianzinn Is that something that I fix with npm link?

No, sorry - that was not a helpful comment as I thought you were working on another repo when you said exporters. The local playground is getting it’s config from here, which has the serialisers registered:  
[https://github.com/BabylonJS/Babylon.js/blob/master/Tools/Config/config.json](https://github.com/BabylonJS/Babylon.js/blob/master/Tools/Config/config.json)

I think deltakosh might have put in a fix as he did a later commit, but otherwise if you are having issues still then I can try. I do live coding on `gulp run`.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 24, 2019, 3:30am UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/12 "2019-02-24T03:30:30Z")

</div>

Yeah I would appreciate seeing if you can get it to actually come up in the build. I’m going to try to do a different change somewhere else just on my local to a more general file like the Mesh class or something and see if that propagates over when I and doing the gulp run. Because as far as I can tell it should be working… I must have missed a step somewhere. I just wanna figure it out ASAP, because it got merged and is a non working feature at the moment even though the script is correct and it builds no problem 😭

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 25, 2019, 3:49pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/13 "2019-02-25T15:49:52Z")

</div>

Here is why:

> <https://github.com/BabylonJS/Babylon.js/commit/049cd924c7649d69f10ea980e28e8554a4f62fee#diff-15e812818c7a3ea50938afe722d7f8e9R1>

In a nutshell, the module mechanism for us to support both UMD and ES6. For UMD (used by the PG) you have to export the code on the BABYLON object.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [February 25, 2019, 5:13pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/14 "2019-02-25T17:13:48Z")

</div>

So that should have fix it?

Ok cool, I was having a minor aneurysm trying to figure this out.

\<3 Thank you so much.

Wow that makes so much sense now, and explains a lot.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 25, 2019, 11:03pm UTC](https://forum.babylonjs.com/t/need-help-with-ts-build/1546/15 "2019-02-25T23:03:56Z")

</div>

it is my pleasure!
