alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)
https://ice.work
MIT License
18k stars 2.1k forks source link

ice3.0 国际化 useLocale() 报index.tsx:26 Uncaught TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator)) #6956

Open dengying918 opened 4 months ago

dengying918 commented 4 months ago

Describe the bug

const [activeLocale, setLocale] = useLocale(); index.tsx:26 Uncau

企业微信截图_17219576082253 企业微信截图_17219576177460

ght TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))

Expected behavior

能正常使用国际化

Actual behavior

No response

Version of ice.js

3.0

Content of build.json or ice.config.mts

export default defineConfig(() => {
  return {
    ssg: false,
    codeSplitting: false,
    minify,
    outputDir: "dist",
    routes: {
      ignoreFiles: [
        "**/components/**", // 忽略被解析成路由组件
      ],
    },
    plugins: [
      i18n({
        locales: ["zh-CN", "en-US"],
        defaultLocale: "zh-CN",
        autoRedirect: true,
      }),
  };
});

Additional context

No response

ClarkXia commented 4 months ago

能否用 with-i18n 提供一个复现 demo,方便判断是插件内部逻辑原因还是其他三方依赖导致

dengying918 commented 4 months ago

能否用 with-i18n 提供一个复现 demo,方便判断是插件内部逻辑原因还是其他三方依赖导致

怎么传demo

ClarkXia commented 4 months ago

提供一个 github 链接,或者上传 zip