Jump to content

"gulp run" - Playground not using local sources - bug or user error?


Recommended Posts

Hi babylonjs team,

I am looking into contributing to babylonjs.

So far,  I have cloned the github repo and installed node & npm. I edited the ts files in question, and I can get them to compile, for example with "gulp typescript-all".

But I ran into a problem trying to test my changes using "gulp run".

This starts a webserver as expected: "Webserver started at http://localhost:1338", but this webserver serves a playground (http://localhost:1338/Playground) that does not use the local babylonjs:

    <!-- Babylon.js -->
    <script src="https://preview.babylonjs.com/cannon.js"></script>
    <script src="https://preview.babylonjs.com/draco_decoder.js" type="text/x-draco-decoder"></script>
    <script src="https://preview.babylonjs.com/Oimo.js"></script>
    <script src="https://preview.babylonjs.com/babylon.js"></script>

So I can't test my changes in this playground, because they don't exist in the online files.

(I got the "gulp run" command from here: https://github.com/BabylonJS/Babylon.js/tree/master/Tools/Gulp )

Please let me know if I got something wrong.


Link to comment
Share on other sites


Are you trying to run directly off of the repro branch? If so, then make sure you pull all necessary files, set up your json.package to include everything you are using. However what is often missed is to run a "yarn install".  Otherwise you most likely won't have all of the necessary files to run directly using the GitHub files. If you already know how to do this, then please provide more info, as the question isn't entirely clear to me after reading your initial post.


Link to comment
Share on other sites

I think he's referring that the babylon.js is coming from the babylonjs.com, but he wants it from http://localhost:1338/.../babylon.js instead, so that his changes are used.  I haven't used the local playground for a while, but was pretty sure at least then that it ran of the latest build I had done.  Let me check where the html file is coming from.

edit:  You want to use: http://localhost:1338/Playground/index-local.html to get the newly generated in /dist/.  

also, gulp "run" also runs tsc watch, so should be kept up-to-date automatically.

Search this page for "The main entry points in BJS are":

Link to comment
Share on other sites

 @brianzinn You are correct, using your URL it works.

An explanation why I tried to use the wrong URL:

I was following this page: https://github.com/BabylonJS/Babylon.js/tree/master/Tools/Gulp and it says:


you can now freely test in the following URLs:

  • Playground
  • Materials Library
  • Postprocess Library
  • Procedural Textures Library
  • Local Dev Samples

But has no actual URLs  - so I just tried /Playground and the playground did come up. (Just not the local one.)

I still consider this kind of weird behavior, and I will make a pull request for the readme.md file to link to the other file with the actual entry points.

Edit: While creating the pull request I noticed, that there are acutally URLs in the readme.md, but they are in quotes - and that causes them to not be displayed on github. - So my pullrequest just fixes that.

Link to PR: https://github.com/BabylonJS/Babylon.js/pull/3817

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...