Comments (15)
Ok I think I found a solution.
I've checked the code and the timeout is set for 5mins so it's not the timeout inside Re.Pack than might be causing the issue, but then I've added short timeout to the request for a bundle: curl "http://localhost:8081/index.bundle?platform=ios" --max-time 10
- the bundle compilation takes around 20+s in TesterApp so curl
should terminate the connection due to timeout and it did and I was finally able to see the infamous Promise may not be fulfilled with 'undefined' when statusCode is not 204
.
As for the solution:
Could someone add return reply;
to the end of the forwardRequest
(line 234) function inside node_modules/@callstack/repack/dist/server/DevServerProxy.js
:
async forwardRequest(platform, request, reply) {
if (!this.workers[platform]) {
await this.runWorker(platform);
}
const {
port
} = await this.workers[platform];
const host = request.headers[':authority'] || request.headers.host;
const url = request.headers[':path'] || request.raw.url;
if (!url || !host) {
reply.code(500).send();
} else {
const compilerWorkerUrl = `http://localhost:${port}${url}`;
this.fastify.log.debug({
msg: 'Fetching from worker',
url: compilerWorkerUrl,
method: request.method,
body: request.body
});
reply.from(compilerWorkerUrl);
}
+ return reply;
}
from repack.
@zamotany This didn't fix it for me unfortunately, i receive the exact same error.
from repack.
Does this happen on a fresh project as well?
from repack.
No, just ours. I think our project may be too big. With metro, our bundle is 25mb+. When trying to use repack, our bundle is about 50mb, and almost always runs out of memory while trying to bundle.
from repack.
Also happening in one of my project. The bundle size is big for me too.
from repack.
Same issue here
from repack.
me too, I refresh the project and this run ok
from repack.
Any clue on how ti solve this bug.? Any help would be appreciated
from repack.
Unfortunately, I don't have any clues. Unless someone provides a reproduction project and I can use, the chances of fixing it are slim.
from repack.
This happens to me also on our relatively large project but I don't run out of memory. It seems like a timeout is being hit in the dev server as the build process continues (as seen in the dashboard). When I wait for the build to finish and reload the app everything is "fine". (quotes because I have issues with some modules, will create a separate issue for these)
This case might be simple to fix by removing/extending a timeout?
from repack.
This case might be simple to fix by removing/extending a timeout?
It's worth a shot. I can provide a diff what to edit and alter the timeout and I'd appreciate if someone can apply it and see if the issue still persists.
from repack.
Sure, I can try this on our codebase 👍
Just to note tho, we're not currently running repack in production. It's only implemented on a WIP/POC branch right now.
from repack.
Ok I think I found a solution.
I've checked the code and the timeout is set for 5mins so it's not the timeout inside Re.Pack than might be causing the issue, but then I've added short timeout to the request for a bundle:
curl "http://localhost:8081/index.bundle?platform=ios" --max-time 10
- the bundle compilation takes around 20+s in TesterApp socurl
should terminate the connection due to timeout and it did and I was finally able to see the infamousPromise may not be fulfilled with 'undefined' when statusCode is not 204
.As for the solution: Could someone add
return reply;
to the end of theforwardRequest
(line 234) function insidenode_modules/@callstack/repack/dist/server/DevServerProxy.js
:async forwardRequest(platform, request, reply) { if (!this.workers[platform]) { await this.runWorker(platform); } const { port } = await this.workers[platform]; const host = request.headers[':authority'] || request.headers.host; const url = request.headers[':path'] || request.raw.url; if (!url || !host) { reply.code(500).send(); } else { const compilerWorkerUrl = `http://localhost:${port}${url}`; this.fastify.log.debug({ msg: 'Fetching from worker', url: compilerWorkerUrl, method: request.method, body: request.body }); reply.from(compilerWorkerUrl); } + return reply; }
returning the reply works for me!
from repack.
This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.
from repack.
This issue has been automatically closed because it has been inactive for more than 14 days. Please reopen if you want to add more context.
from repack.
Related Issues (20)
- has anyone integrated @storybook/react-native v7.x successfully with re.pack HOT 1
- [Docs] Module Resolution HOT 1
- Vendored Device class is broken when it comes to debugging HOT 3
- [Docs] Tree-shaking benchmark of RN app HOT 2
- Brotli decompression HOT 2
- RePack with rn_nodeify HOT 2
- Apk not launching HOT 5
- ERROR while setting up code signing HOT 2
- Issue with node v22.0.0 HOT 4
- Error: repack react native module was not found. Did you forget to update native dependencies? HOT 7
- TypeError: webpackContext.u is not a function (it is undefined)
- Property SentryError doesnt exist HOT 3
- ChunkLoad Error HOT 3
- bundling mini-apps cause crashes HOT 18
- How to config webpack to reuse existing dependencies from the main bundle HOT 4
- How to debug blank screen issue with no error output? HOT 23
- Question: getting the error: "File assets/images/<imageName>@3x.png for ios not found in compilation assets" HOT 4
- ChunkManagerPackage: No value passed for parameter 'p6' HOT 10
- More control over file path and URL for remote assets HOT 4
- Module Federation host app not working [ScriptManager] failed to load script : [NetworkFailure] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repack.