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

[Bug]: 自定义 entry.tsx 时无法构建 #6200

Closed
lanmingle opened this issue Sep 9, 2024 · 6 comments
Closed

[Bug]: 自定义 entry.tsx 时无法构建 #6200

lanmingle opened this issue Sep 9, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@lanmingle
Copy link

lanmingle commented Sep 9, 2024

版本信息

2.59.0

windows 10 (已测试mac和liunx没有问题)

问题详情

entry.tsx

import { createRoot } from '@modern-js/runtime/react';
import { render } from '@modern-js/runtime/browser';

const ModernRoot = createRoot();

async function beforeRender() {
  console.log('beforeRender');
}

beforeRender().then(() => {
  render(<ModernRoot />);
});

报错:Module not found: Error: Can't resolve '@_modern_js_srcentry.tsx' in 路径\node_modules.modern-js\main

编译出来的 index.jsx

import '@modern-js/runtime/registry/main';
  import '@_modern_js_src\entry.tsx'
export * from '@_modern_js_src\entry.tsx'

手动修改 路径\node_modules.modern-js\main\index.jsx

import '@modern-js/runtime/registry/main';
  import '@_modern_js_src/entry.tsx'
export * from '@_modern_js_src/entry.tsx'

复现链接

暂无

复现步骤

不论是 webpack 还是 rspack 都一样

@lanmingle lanmingle added the bug Something isn't working label Sep 9, 2024
@zllkjc
Copy link
Member

zllkjc commented Sep 10, 2024

看起来是拼路径的问题 @caohuilin ,有空可以看看~

@caohuilin caohuilin self-assigned this Sep 10, 2024
@caohuilin
Copy link
Member

看起来是拼路径的问题 @caohuilin ,有空可以看看~

好的

@caohuilin
Copy link
Member

#6205

@caohuilin
Copy link
Member

@lanmingle This bug has been fixed. You can use the nightly version "@modern-js/plugin-garfish":"0.0.0-nightly-20240910170704" first. We will publish on Thursday.

@lanmingle
Copy link
Author

@caohuilin 额。。。这个我在测试的时候,没有使用 garfish 相关,基于生成器生成一个项目,直接添加 entry.tsx 就出现上述的问题。

@caohuilin
Copy link
Member

@lanmingle 如果没有使用 garfish 插件,生成的内容是不应该存在 export * from '@_modern_js_src/entry.tsx' 的,你再 check 一下看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants