node.js - node.isAncestor 不是一个函数

标签 node.js angular angular-universal server-side-rendering

当我运行 npm run build:ssr 命令时,它成功返回应用程序 url。见下文

Node 服务器监听 http://localhost:4000

在浏览器中点击网址时,出现以下错误。

ERROR TypeError: node.isAncestor is not a function
    at DocumentFragment._ensureInsertValid (D:\xampp\htdocs\abc\dist\server.js:80983:14)
    at DocumentFragment.insertBefore (D:\xampp\htdocs\abc\dist\server.js:81113:12)
    at DocumentFragment.value (D:\xampp\htdocs\abc\dist\server.js:81129:17)
    at buildFragment (D:\xampp\htdocs\abc\dist\server.js:305246:26)
    at domManip (D:\xampp\htdocs\abc\dist\server.js:306281:14)
    at jQuery.fn.init.append (D:\xampp\htdocs\abc\dist\server.js:306472:10)
    at Owl.initializeStage (D:\xampp\htdocs\abc\dist\server.js:382409:17)
    at Owl.initialize (D:\xampp\htdocs\abc\dist\server.js:382471:8)
    at new Owl 

最佳答案

看起来您正在使用 owl 轮播,Owl 使用的是 jQuery,SSR 不支持它,并且无法在服务器端渲染。

关于node.js - node.isAncestor 不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59170396/

相关文章:

node.js - 使用Express作为Feed时,如何打包 Electron 应用程序?

mysql - NodeJs Mysql错误: ER_PARSE_ERROR Insert to multiple table

javascript - typescript 代码 : How to calculate Totale=Sum(Subtotale) and price* quantita = subtotale Angular5

angular - 类型 '() => Observable<any>' 不可分配给类型 '() => Observable<any>'

mysql - Angular Universal 中的异步 Node.js 请求。服务器渲染停止工作

javascript - 生成两个已知点之间的坐标

javascript - Webpack url 不正确

javascript - 函数未在 Angular2 上执行

node.js - 无法解析 Angular Universal 的依赖项

javascript - 如何修复 angular 6 universal server.js 中的 "ReferenceError: window is not defined"错误