electron-api-demos icon indicating copy to clipboard operation
electron-api-demos copied to clipboard

Uncaught TypeError: Cannot read property 'querySelector' of undefined

Open joaodematejr opened this issue 3 years ago • 9 comments

  • 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) } })

joaodematejr avatar Nov 04 '21 17:11 joaodematejr

Same problem at win 10, and linux manjaro.

gzx-miller avatar Nov 05 '21 08:11 gzx-miller

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

ViktorFilonenko avatar Nov 11 '21 08:11 ViktorFilonenko

same problem at win11,node16.5.0

lichong-a avatar Nov 28 '21 15:11 lichong-a

some issue: Uncaught TypeError: Cannot read property 'querySelector' of undefined、、、、 For me, a novice, I look confused。

LeiMingZ avatar Dec 01 '21 16:12 LeiMingZ

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

wangjianxiang avatar Dec 03 '21 07:12 wangjianxiang

image

I have the same problem at win10, node 14.15.1, npm 6.14.8

coofive avatar Dec 08 '21 14:12 coofive

[Mickey]已经收到了,谢谢

miki-long avatar Dec 08 '21 14:12 miki-long

因为 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。

youyou12344 avatar Dec 20 '21 08:12 youyou12344

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

Always-beginner avatar Jun 29 '22 06:06 Always-beginner