Closed jhso-dev closed 1 month ago
Hi @jhso-dev, what version of Re.Pack is this from?
@jbroma Hi jbroma, I am using repack 3.7.0 and react-native 0.73.7. I also tried it with 4.1.1 Thanks in advance!
Can you share a reproduction repository please? I'm not able to pinpoint anything from the trace you've provided. No clue how 'chunk' could end up as a platform 🤔.
I also can't locate the error from this trace, I've check 3.7.0 and 4.1.1 and none of them match this:
TypeError: Cannot read properties of undefined (reading 'forEach')
at Worker.<anonymous> (/Users/x/dev/client/node_modules/@callstack/repack/dist/webpack/Compiler.js:107:36)
at Worker.emit (node:events:517:28)
at MessagePort.<anonymous> (node:internal/worker:256:53)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28)
EDIT: The only thing that comes to mind is customizing platform
through CLI args, can you verify that you are not passing --platform=chunk
anywhere in your config by mistake?
@jbroma Hi jbroma :)
I did some research and found that the platform(chunk) is parsed from the URL from getSourceMap http://localhost:8081/ios/src_app2_tsx-node_modules_react-native-reanimated_src_reanimated2_sync_recursive.chunk.bundle
Please refer to the source below: https://github.com/callstack/repack/blob/c0f9b7eaddffed993f488594d9ffd507214f9df9/packages/repack/src/commands/start.ts#L263
So, if I manually change the platform from parseFileUrl to either ios or android, it seems to work correctly.
Oh, now with the added context it makes way more sense! Great find, that's definitely a bug that needs to be fixed, would you like to open a PR with a fix for that?
@jbroma please review the pull request when you have a moment? Thank you! https://github.com/callstack/repack/pull/647
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.
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.
Fixed by #647
Is it possible for chunk to be passed into Platform? I encountered the following error and upon investigation, I found that chunk is being passed into Platform.