当我运行 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/