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

vite模式无法启动 #5527

Closed
Symous opened this issue Nov 5, 2022 · 1 comment
Closed

vite模式无法启动 #5527

Symous opened this issue Nov 5, 2022 · 1 comment

Comments

@Symous
Copy link

Symous commented Nov 5, 2022

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

ice2.x切换到vite模式无法启动,相关报错如下:

第一个错误:
Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.

查找各种相关社区解决方案,仍然无法生效,如:vite官方解决方案:vitejs/vite#9387

第二个错误:
无法识别装饰器语法;
[ERROR] Unexpected "@"
查找各种相关社区解决方案,仍然无法生效,如:

    vitePlugins: [
        reactSupport({
            babel: {
                // parserOpts: {
                //     plugins: ['decorators-legacy'],
                // },
                plugins: [
                    ["@babel/plugin-proposal-decorators", { legacy: true }],
                    ["@babel/plugin-proposal-class-properties", { loose: true }],
                ]
            }
        })
    ],

请问该如何修复相关问题?

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

Any additional comments? 相关环境信息?

  • ice.js Version:2.6.6
  • build.json Configuration
  • Node Version: 16.15.0
  • Platform: macOS 12.4
@Symous Symous changed the title ice2.x切换vite模式无法启动 vite模式无法启动 Nov 5, 2022
@ClarkXia
Copy link
Collaborator

ClarkXia commented Nov 7, 2022

提供下复现 demo,看下用的哪个模版

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

No branches or pull requests

2 participants