ice-lab / ice-next

The repo was transferred to https://github.com/alibaba/ice
https://v3.ice.work/
MIT License
53 stars 7 forks source link

ssr:false关闭好像不起作用啊 #673

Closed jianmaikj closed 1 year ago

jianmaikj commented 1 year ago

What is the current behavior? 发生了什么?

defineConfig设置ssr:false关闭好像不起作用啊

还是会通过nodejs运行,报错:navigator is not defined

What is the expected behavior? 期望的结果是什么?

Any additional comments? 相关环境信息?

chenjun1011 commented 1 year ago

再加上 ssg: false, 默认还是会用 SSG 去渲染页面

wssgcg1213 commented 1 year ago

通过 nodejs 运行是一种行为,SSR 和 SSG 都会触发这个行为, 两种解决办法

  1. 通过判断在浏览器中的状态后再访问 BOM Objects
  2. 同时关闭 SSG 和 SSR