Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Uncaught TypeError: Cannot read property 'querySelector' of undefined #508

Open
joaodematejr opened this issue Nov 4, 2021 · 9 comments

Comments

@joaodematejr
Copy link

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

@gzx-miller
Copy link

Same problem at win 10, and linux manjaro.

@ViktorFilonenko
Copy link

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

@lichong-a
Copy link

same problem at win11,node16.5.0

@LeiMingZ
Copy link

LeiMingZ commented Dec 1, 2021

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

@wangjianxiang
Copy link

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

@coofive
Copy link

coofive commented Dec 8, 2021

image

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

@miki-long
Copy link

miki-long commented Dec 8, 2021 via email

@youyou12344
Copy link

youyou12344 commented Dec 20, 2021

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

@Always-beginner
Copy link

Always-beginner commented Jun 29, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants