DevTools failed to load source map: Could not load content for https://localhost:8080/modules/babylonjs.materials.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
I am editing a project locally (java script) without npm just with referencing to the .min packages which I put in a subfolder.
The project is working fine, but I get these errors on all the modules I load in the browser console.
You are not doing anything incorrectly unless you want to be able to debug actual source/line numbers when using the minified versions. In that case, you need to put the javascript source map files in place beside the minified JS files. If you do not care and the errors bug you, then you can also disable JS source map file loading. It’s a setting in the developer console usually titled something like “Enable Source Maps”.
And on a side note, source maps are very helpful for debugging, so i would personally recommend adding them as well . The app will work well without them, of course
oh, no. we provide sourcemaps to all of our js files. Not sure what the “modules” directory is and where you got the files from, but the .map files should be right where you got the .js files. download them and put them in the same directory.
Again, this is optional and just for debugging purposes. also note that if you serve .map files in production, your js won’t be seen minimized or obfuscated if debugged using the dev tools
You don’t have to use typescript. Just reference index.js as the entry instead of index.ts in the template you are using, and it should (emphasis on should) work, if everything is set up correctly. Not sure why you want to use the minified version during development, but you can decide which version to consume in your packer setup.
Okay.
Actually I dont wanna use it in the development, or lets say I dont know if/why/why not etc.
The final result should probably be the minimized version.(?).
I guess we dont understand the concept of the packages, packer setup aso.
So probably we need to learn a bit more first.
There are quite a couple of concepts, which are very different.
This is a bit out of the scope of this forum, but a bundler/packer/nameitasyouwish-er) takes all of your application’s resources and bundles them together to a deliverable resource that can be used (usually) to serve your website. I didn’t read this entire article (and certainly didn’t write it) but maybe this could be a nice intro:
Yes, the final result should be minified for performance reasons. While developing though, you want to be able to debug your application, and that’s only possible when not using a minified version (or when using a sourcemap file that your bundler can generate for you).
I would read about bundlers (webpack is probably the most documented of them all, but there are others!), understand a bit more about web delivery. But that’s more advanced stuff and has technically nothing to do with your babylon.js app. Start with the minified version from the CDN, and when you get to a point that you need to optimize your build take the next steps.