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

store 报错 Cannot read properties of null (reading 'store') #6950

Open
lxzy-yun opened this issue Jul 17, 2024 · 3 comments
Open

store 报错 Cannot read properties of null (reading 'store') #6950

lxzy-yun opened this issue Jul 17, 2024 · 3 comments
Assignees
Labels

Comments

@lxzy-yun
Copy link

lxzy-yun commented Jul 17, 2024

Describe the bug

WX20240717-163216@2x
image

Expected behavior

修改models 后热更新正常

Actual behavior

No response

Version of ice.js

v3.4.10

Content of build.json or ice.config.mts

No response

Additional context

最小复现仓里:https://github.com/lxzy-yun/ice3-withStore.git

@lxzy-yun lxzy-yun added the bug label Jul 17, 2024
@ClarkXia ClarkXia self-assigned this Jul 17, 2024
@ClarkXia ClarkXia changed the title ice3,Cannot read properties of null (reading 'store'),此错误长期存在,望修复 store 报错 Cannot read properties of null (reading 'store') Jul 17, 2024
@lxzy-yun
Copy link
Author

lxzy-yun commented Oct 8, 2024

似乎找到了原因点,每个 pages 文件夹下的页面文件都需要暴露一个变量就不会报错了

export default function Layout() {
  const [{ theme }] = store.useModel('frameworkData');

  return (
    <ConfigProvider theme={theme} locale={zhCN}>
      <div style={{ height: '100%' }}>
        <Outlet />
        {JSON.stringify(theme)}
      </div>
    </ConfigProvider>
  );
}
export const a = [];  // 随意写一个

@ClarkXia 应该是某个插件引起的

@lxzy-yun
Copy link
Author

lxzy-yun commented Oct 8, 2024

最小复现仓库已经上传了
image

@ClarkXia
Copy link
Collaborator

ClarkXia commented Oct 9, 2024

主要由 hmr 模块导致的问题,我们修复下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants