callstack / callstack/super-app-example

ReferenceError: Can't find variable: __webpack_require__

未关闭
#6 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
Java
星标
40
派生
23
PR 合并指标
30 天内没有已合并 PR

描述

**Environment**
`Host app`
React Native: 0.72.3
Repack: 3.7.0
Webpack: 5.91.0
OS: MacOS 13.6.3 - Chip M1 Pro
Xcode: 15.2

**Description**
I've cloned your repo, I move into `host-app`, setup environment callstack/repack. I stop `metro` and run `react-native webpack-start` with host is my IP Address but it show this, i think it doesn't receive the `webpack local`
Thank you.

Here is my `index.js`
```
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
import {ScriptManager, Federated} from '@callstack/repack/client';

ScriptManager.shared.addResolver(async (scriptId, caller) => {
const resolveURL = Federated.createURLResolver({
containers: {
MiniApp: 'http://localhost:9000/[name][ext]',
},
});

const url = resolveURL(scriptId, caller);
if (url) {
return {
url,
query: {
platform: Platform.OS,
},
};
}
});

ScriptManager.shared.on('resolving', (...args) => {
console.log('DEBUG/resolving', ...args);
});

ScriptManager.shared.on('resolved', (...args) => {
console.log('DEBUG/resolved', ...args);
});

ScriptManager.shared.on('prefetching', (...args) => {
console.log('DEBUG/prefetching', ...args);
});

ScriptManager.shared.on('loading', (...args) => {
console.log('DEBUG/loading', ...args);
});

ScriptManager.shared.on('loaded', (...args) => {
console.log('DEBUG/loaded', ...args);
});

ScriptManager.shared.on('error', (...args) => {
console.log('DEBUG/error', '111111111111');
console.log('DEBUG/error', ...args);
});
AppRegistry.registerComponent(appName, () => App);
```

Screenshot 2024-04-02 at 15 11 16

贡献指南

打开贡献指南

调研方向

从 host-app/index.js 开始,使用报告中的 host 配置,通过 React Native 0.72.3、Re.Pack 3.7.0 和 webpack-start 重现该问题。跟踪报告的 __webpack_require__ 错误附近的 webpack 启动和 bundle 加载路径。当 host 应用在没有 ReferenceError 的情况下启动并接收到本地 webpack bundle 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, react-native, webpack
领域
build-system, mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。