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

请问一下,form-render是否不支持服务器端渲染? #1297

Closed
mexhfl opened this issue Jun 13, 2023 · 1 comment
Closed

请问一下,form-render是否不支持服务器端渲染? #1297

mexhfl opened this issue Jun 13, 2023 · 1 comment
Assignees

Comments

@mexhfl
Copy link

mexhfl commented Jun 13, 2023

1.依赖仓库的版本(Dependencies versions)

  • react:18.2.0
  • form-render:2.2.7
  • table-render:
  • antd:
  • next.js: 13.4.5

2.问题描述(Bug description)

在一个新的next.js项目中引入form-render之后,报以下错误:

./node_modules@ant-design\icons\es\components\Context.js
ReactServerComponentsError:

You're importing a component that needs createContext. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.

,-[D:\Products\AgileTools\test-next\node_modules@ant-design\icons\es\components\Context.js:1:1]
1 | import { createContext } from 'react';
: ^^^^^^^^^^^^^
2 | var IconContext = /#PURE/createContext({});
3 | export default IconContext;
`----

Maybe one of these should be marked as a client entry with "use client":
./node_modules@ant-design\icons\es\components\Context.js
./node_modules\antd\es\config-provider\index.js
./node_modules\form-render\lib\form-core\index.js
./node_modules\form-render\lib\index.js
./src\app\page.tsx

3.出现问题的 schema demo(Reproduction schema demo)
任何的schema都会导致上述问题,上述问题可能不是schema的问题

请问一下,这个问题是否有解决办法?form-render是否无法实现服务器端渲染?

@lhbxs
Copy link
Collaborator

lhbxs commented Jun 13, 2023

#1299

@lhbxs lhbxs closed this as completed Jun 13, 2023
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

2 participants