callstack / super-app-example

This repository presents a compact super-app example from Callstack's blog, illustrating the use of a monorepo structure together with Re.Pack and Module Federation.
MIT License
27 stars 16 forks source link

Property '__webpack_require__' doesn't exist. #4

Open Jaysalasi opened 11 months ago

Jaysalasi commented 11 months ago

Ask your Question

Hi I have done the setup and when I run 'yarn run:host-app:android' i get the error: Property '__webpack_require__' doesn't exist.

image

jbroma commented 11 months ago

Hi @Jaysalasi,

It looks to me that instead of starting Re.Pack dev-server you've started metro instead. Please run yarn webpack-start instead of yarn start.

I can also see that you're using Windows - please use .cjs template instead of .mjs one as that one might cause problem - we are actively working on sorting that out!

Jaysalasi commented 11 months ago

Thanks. I changed from.mjs to .cjs and then I run yarn webpack-start from my root folder and I got this error

$ yarn webpack-start Usage Error: Couldn't find a script named "webpack-start".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] ...

so i tried yarn react-native webpack-start i get this error image

jbroma commented 11 months ago

it's yarn react-native webpack-start my bad there :)

Jaysalasi commented 11 months ago

@jbroma Thanks… No problem… But I get this error now

BF3C18DC-9F46-4101-A5C0-40CD4D75065C

jbroma commented 11 months ago

make sure to run adb reverse tcp:8081 tcp:8081 or other port that you are using. You can also try to to go into developer menu (on Mac it's CMD + M for android, so I suppose it's something similar for Windows as well) and going into Change Bundle location and entering localhost:8081 there.

Jaysalasi commented 11 months ago

@jbroma I restarted my computer and now yarn react-native webpack-start is not working anymore, but yarn start is working

image

jbroma commented 11 months ago

that's rather unusual, perhaps try reinstalling your dependencies?

Jaysalasi commented 11 months ago

sorry... I was trying it at the root folder.

Jaysalasi commented 11 months ago

yarn react-native webpack-start does not run in the root folder. is that normal?

Jaysalasi commented 11 months ago

I get this error now

image

image

jbroma commented 11 months ago

make sure to run adb reverse tcp:8081 tcp:8081 or other port that you are using. You can also try to to go into developer menu (on Mac it's CMD + M for android, so I suppose it's something similar for Windows as well) and going into Change Bundle location and entering localhost:8081 there.

try these steps again

Jaysalasi commented 11 months ago

I tried adb reverse tcp:8081 tcp:8081 nothing happened.

I am using a real device not a simulator

Jaysalasi commented 11 months ago

I want to suggest something.

can you write down the sequence of commands to run starting from the first after git cloning the template. Thanks

shailesh-daund commented 8 months ago

Having the same issue while running the Host app.

Screenshot_20231228_190749_HostApp

Also when navigating to mini app from host app having the following issue.

Screenshot_20231228_193826_HostApp

@Jaysalasi If you are able to solve this issue, it will be beneficial if you post the solution for the same.

NguyenTran153 commented 6 months ago

Having the same issue while running the Host app.

Screenshot_20231228_190749_HostApp

Also when navigating to mini app from host app having the following issue.

Screenshot_20231228_193826_HostApp

@Jaysalasi If you are able to solve this issue, it will be beneficial if you post the solution for the same.

I have same error too

shakeelkoper commented 1 month ago

@jbroma I want to suggest something. can you write down the sequence of commands to run starting from the first after git cloning the template. Thanks