I have an html file that imports Babylon and then another js file via script tags. In the second file I get errors:
Though I have loaded Babylon and when I test the HTML file, it works fine.
Anyway to resolve this?
I am using a separate Javascript file, not Typescript.
the babylon namespace is being populated if you use our UMD version. if you use some other method you will need to take care of referencing the babylon types correctly.
Sharing a reproduction or the project will help us help you
The only relevant differences are some classes (Entity, Ship, PlayerData, Planet, Star, …) are moved to core.js, and all Babylon classes are prefixed with the namespace BABYLON. In index.html, an extra line is added right after the socket.io import (at line 574): <script class=core src=core.js></script>
My IDE is VS Code, which I mentioned in the initial post
Adding //global BABYLON does not appear to affect anything
After adding "javascript.validate.enable": false to my settings, all errors go away (I tried adding intentional syntax errors and that didn’t generate any errors which is NOT intended). Continuing to read the first Stack Overflow post, adding the other settings did not affect the errors at all.
After reading the jsconfig.json Reference, I tried adding an include path and changing the module system but night have worked.
I also tried the ESLint extension which removed all but syntax errors (which kind of works)
From this, is there a babylon .d.ts file I could use?
I downloaded your repository and I don’t have that error in the VS Code. It does look like it’s problem specific to your toolset. I can’t help you if I can’t reproduce the error on my machine.