Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'value' of null #528

Closed
PeterChen1997 opened this issue Apr 1, 2021 · 8 comments
Closed

Uncaught TypeError: Cannot read property 'value' of null #528

PeterChen1997 opened this issue Apr 1, 2021 · 8 comments

Comments

@PeterChen1997
Copy link
Contributor

PeterChen1997 commented Apr 1, 2021

当 Angular 项目在 prod 环境下时,运行最新的 rrweb 会报错,但是在 dev 环境下不会,求大佬帮看下,sources 截图在最后 @Yuyz0112

Uncaught TypeError: Cannot read property 'value' of null
    at MutationBuffer.emit (vendor.ee0b6f5aab4612176eaa.js:60756)
    at MutationBuffer.processMutations (vendor.ee0b6f5aab4612176eaa.js:60629)
    at ZoneDelegate.invoke (polyfills.2666f01771c38fa5496d.js:589)
    at Zone.runGuarded (polyfills.2666f01771c38fa5496d.js:333)
    at MutationObserver.<anonymous> (polyfills.2666f01771c38fa5496d.js:304)
while (addList.length) {
      var node = null;

      if (candidate) {
        var parentId = _utils_js__WEBPACK_IMPORTED_MODULE_2__["mirror"].getId(candidate.value.parentNode);
        var nextId = getNextId(candidate.value);

        if (parentId !== -1 && nextId !== -1) {
          node = candidate;
        }
      }

      if (!node) {
        for (var index = addList.length - 1; index >= 0; index--) {
          var _node = addList.get(index);

          // 此行报错
          var parentId = _utils_js__WEBPACK_IMPORTED_MODULE_2__["mirror"].getId(_node.value.parentNode);
          var nextId = getNextId(_node.value);

          if (parentId !== -1 && nextId !== -1) {
            node = _node;
            break;
          }
        }
      }

      if (!node) {
        while (addList.head) {
          addList.removeNode(addList.head.value);
        }

        break;
       // ...
}

image

@PeterChen1997
Copy link
Contributor Author

我看了下部分情况下报错其实不影响录制,不知道这个报错是否会影响生产环境,如果不影响的话,可以加个 catch 吗

@arpowers
Copy link

arpowers commented Apr 2, 2021

@Yuyz0112 can verify we are getting this issue as well.

@YunFeng0817
Copy link
Member

@PeterChen1997 能否提供一个能复现问题的仓库或者项目,可能方便排查问题

@arpowers
Copy link

arpowers commented Apr 3, 2021

The issue in source looks like it's here:

(_node.value.parentNode as Node) as INode,

@PeterChen1997
Copy link
Contributor Author

angular-zpawda 2.zip
没有用 git,因为需要本地操作,直接发 zip 了哈 @Mark-Fenng @Yuyz0112

下载后直接看 dist/demo 的 html 即可,切换到 tab2 即可复现

重新 build 的话走如下流程

npm i --legacy-peer-deps
npm run build

@PeterChen1997
Copy link
Contributor Author

angular-zpawda 2.zip
没有用 git,因为需要本地操作,直接发 zip 了哈 @Mark-Fenng @Yuyz0112

下载后直接看 dist/demo 的 html 即可,切换到 tab2 即可复现

重新 build 的话走如下流程

npm i --legacy-peer-deps
npm run build

这个是必现的问题,麻烦大佬们帮忙看看

@YunFeng0817
Copy link
Member

@PeterChen1997 After some test, I confirm that the root cause is the same as issue(#491) and the only thing we need is a release.

@neilkakkar
Copy link

Hi @Mark-Fenng , @Yuyz0112 - do you have an idea of when the next release will happen? We're using rrweb at PostHog and run into this same issue occasionally.

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

No branches or pull requests

4 participants