Encountering this particular error message in the console while attempting to run the application:
webcomponents-lite.js:64Uncaught TypeError: Cannot read property 'getAttribute' of null
at webcomponents-lite.js:64
at Object.549 (webcomponents-lite.js:74)
at __webpack_require__ (bootstrap a218042…:52)
at Object.1242 (webcomponents.bundle.js:8)
at __webpack_require__ (bootstrap a218042…:52)
at webpackJsonpCallback (bootstrap a218042…:23)
at webcomponents.bundle.js:2
This is the method I am using to load the script with webpack:
entry: {
'polyfills': './src/polyfills.browser.ts',
'vendor': './src/vendor.browser.ts',
'main': './src/main.browser.ts',
'webcomponents': './bower_components/webcomponentsjs/webcomponents-lite.js',
},
This issue arises when using the webpack entry object, yet it functions without errors if I include the following directly in my index.html page:
<script src="/webcomponentsjs/webcomponents-lite.js"></script>
Has anyone encountered and resolved a similar problem?
EDIT::::
Both my coworker and I have identical versions of bower_components and node_components, having uninstalled and reinstalled everything. Strangely, his setup works whereas mine did not. Upon inspecting the bower_components directory, we noticed discrepancies in files and folders between our setups (for reasons unknown). After exchanging the bower_components folder from their working project to mine and replacing my existing files with theirs, the application functioned correctly.