As part of a practice project where I'm focusing on using webpack, ES6, npm and Typescript implementation, I have successfully set up loaders for 'awesome-typescript-loader' and 'babel-loader', which are bundling the code properly.
However, when testing this snippet:
document.getElementById('test-id').innerHTML = 'asdf';
I encounter an error in the browser console, even though the code is working as intended and injecting the string 'asdf' into the specified ID.
I've attempted switching to the alternative loader 'ts-loader', using querySelector()
instead of getElementById()
, assigning the element to a variable before setting the .innerHTML
, but none of these solutions have resolved the issue.