electron-api-demos
electron-api-demos copied to clipboard
Uncaught TypeError: Cannot read property 'querySelector' of undefined
- What operating system are you using? Windows 11
- What version of Node.js is on your system? v14.18.1
Array.prototype.forEach.call(links, (link) => { let template = link.import.querySelector('.task-template') let clone = document.importNode(template.content, true) if (link.href.match('about.html')) { document.querySelector('body').appendChild(clone) } else { document.querySelector('.content').appendChild(clone) } })
Same problem at win 10, and linux manjaro.
Hi, Same issue for Mac and I think for everybody who have updated their Chrome https://www.chromestatus.com/feature/5144752345317376
Only way is to get rid of rel="import" in favour of other loading mechanism.
Env was: Node.js 16.5.0, Chromium 94.0.4606.81, and Electron 15.3.1
same problem at win11,node16.5.0
some issue: Uncaught TypeError: Cannot read property 'querySelector' of undefined、、、、 For me, a novice, I look confused。
Uncaught TypeError: Cannot read property 'app' of undefined at Settings._getSettingsFilePath (D:\projects\source-code\webStorm\electron\electron-api-demos\node_modules\electron-settings\lib\settings.js:75) at Settings._ensureSettings (D:\projects\source-code\webStorm\electron\electron-api-demos\node_modules\electron-settings\lib\settings.js:147) at Settings._readSettings (D:\projects\source-code\webStorm\electron\electron-api-demos\node_modules\electron-settings\lib\settings.js:192)
I have the same problem
I have the same problem at win10, node 14.15.1, npm 6.14.8
[Mickey]已经收到了,谢谢
因为 electron 版本太高,对应的 chromium 版本不支持 html imports
。
解决方法:
在 package.json 中降低 electron 的版本为 ^7.2.4
。
package-lock.json 中删除 "electron"。
Because the electron version is too high, the corresponding chromium version does not support 'HTML imports'.
Solution:
The version of electron in package.json is reduced to ^ 7.2 4
。
delete "electron" in package-lock.json。
That's working for me thank you!!
first, delete electron js from node_module then reduce your package JSON version to ^7.2.4 after re-download this version of electron and it's working fine.! thank you @youyou12344