When I write something simple in app.js like
$("#myID").removeClass("show");
I get an error in the console saying that: Uncaught TypeError: $ is not a function
I am writing it in // application code
:
import {domReady} from '@roots/sage/client';
/**
* app.main
*/
const main = async (err) => {
if (err) {
// handle hmr errors
console.error(err);
}
// application code
$("#myID").removeClass("show");
};
/**
* Initialize
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
domReady(main);
import.meta.webpackHot?.accept(main);