Comments (6)
给最小复现
from egg-react-ssr.
首先我非常喜欢你们的脚手架,项目结构简洁干净,同时支持ts,我想要的实现是部分路由是ssr,其他部分是csr-spa
- 运行npm run csr会失败,报错Invariant failed: You should not use outside a (抱歉,昨天复制错误),我所知道的是因为路由嵌套问题
- 文档中提到__isBrowser__ 切换ssr和csr,但是因为第一步失败,导致无法研究剩下的实现
from egg-react-ssr.
@yxbgithub1 好的,我们查一下
from egg-react-ssr.
首先我非常喜欢你们的脚手架,项目结构简洁干净,同时支持ts,我想要的实现是部分路由是ssr,其他部分是csr-spa
- 运行npm run csr会失败,报错Invariant failed: You should not use outside a (抱歉,昨天复制错误),我所知道的是因为路由嵌套问题
- 文档中提到__isBrowser__ 切换ssr和csr,但是因为第一步失败,导致无法研究剩下的实现
给一个复现的仓库地址。你那个错我知道是什么原因是因为多个react-router实例冲突,这个错误我在很早的版本就修复了不知道你是不是改了什么代码导致出错
isBrowser 不是切换ssr/csr的只是一个标志环境变量而已
不支持路由级别的渲染模式模式定制,你通过config.type可以指定整个项目的渲染模式。有更多的疑问可以扫码进群交流
from egg-react-ssr.
我也遇到了这个问题,直接用 ykcli init
生成的 typescript
项目,没有改动任何代码,运行 npm run csr
报错 Error: Invariant failed: You should not use <Link> outside a <Router>
。
环境:
mac os 10.14.6
node 12.12.0
yk-cli 2.7.2
from egg-react-ssr.
@Zero2key @yxbgithub1 ts的example看了一下确实有问题,已修复,js的example没问题,可以看看commit具体改了哪个地方新的复制过去即可。或者重新init一遍项目
from egg-react-ssr.
Related Issues (20)
- CSR渲染使用useReactToString或者isRax会报错 HOT 1
- 脚手架问题 HOT 8
- 浏览器端接手数据怎么获取 HOT 1
- config.ssr生产环境路径问题 HOT 3
- dist文件里面的d.ts是必须的吗? 如果不是如何阻止生成 HOT 1
- 打包的文件是否支持Hash。如何解决浏览器缓存问题。 HOT 2
- 钉钉二维码已过期 HOT 2
- 针对layout优化还是不太理解 HOT 7
- getIntialProps里对象嵌套对象会失效,是只能用平级数据嘛 HOT 3
- CRA 迁移文档有木有 HOT 2
- 关于用loadable分割加载css的问题 HOT 32
- 我司商城项目正在使用此框架 HOT 2
- 在example中的ssr-with-ts项目里yarn prod 之后报错 HOT 1
- head标签嵌入功能 HOT 8
- 使用你们的框架重构了我们公司的官网 HOT 2
- SSR模式下引入antd 没有交互 HOT 1
- 为什么 npm prod 之后 请求的静态资源报错 HOT 1
- 按照官网教程来安装,启动就报错了,模板是 nestjs-react-ssr HOT 2
- ssr-with-js template 启动不正确 HOT 1
- 使用嵌套路由时,会出现含有路由组件的父组件被卸载的问题 HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egg-react-ssr.