understrap / understrap-child

The starter child theme for Understrap, the renowned open-source WordPress starter theme.
GNU General Public License v3.0
581 stars 331 forks source link

console.log("Something"); from custom-javascript.js outputs nothing? #374

Closed dekkydog closed 1 year ago

dekkydog commented 1 year ago

Understrap-child - 1.2.0 WP - 6.1.1 PHP - 8.08 NodeJS - 16.15.1

Hi there, been baffled by the inability to output console.log("something"); in Chrome developer console from 'custom-javascript.js'? I've literally trawled though all the stackoverflow.com issues around this subject. I've reset Chrome Dev Tools. Turned off any Browser Extensions. Tried different browser developer tools...etc...etc... and still no joy?

I switched to another WP build (not using understrap theme) and voila! console.log("something"); outputs ...something.

So could anything be suppressing console.log() messages within the theme framework?

Any advice appreciated :-)

dekkydog commented 1 year ago

Finally found out the issue. For anyone else who encounters this..... Just edit the following in src/build/terser.config.json:

....... "drop_console": false, "drop_debugger": false, .......

I unfortunately was not aware of this!