Can anyone show me how to debug js file with source map?

Hi,

I need to customize some code but files are minified, with source map in the same folder of course.
I really can’t find the way to combine files to have a dev-readable code. I have used Chrome debug tools , it can detect source map of the file, however it ask for source map file to be added in the file-tree, I filled in filename, url to that file bot there no response afterward. I have use Firefox debug tools as well, it show me nothing related to source map.
Server have set debug setting as true. Both browsers are source mapping enabled in settings.

You can see example files here: https://github.com/nextcloud/files_videoplayer/tree/master/js

I even want to debug to get source code in VScode, but lack of experience. This minified files but with no instruction to reverse back is kind of something adding more complex for a new contributor like me.

Could anyone give me any possible ways to get the source code, please ?
Please help, thanks.

This might be an issue with your webserver not serving the map files. For apache we recently merged a change to the .htaccess generation to do exactly that: https://github.com/nextcloud/server/pull/16006/files

Once adjusting your config manually with the change you should be able to use the browsers debugging capabilities with the original source files.

1 Like