Comments (12)
Can you prepare a repro project? Something is wrong with the way your project is being built, because it should never load chunk with such URI - noop://
.
from repack.
@DanijelBojcic localChunks
matches only chunk name
(or id
if can cannot be obtained), so /\.chunk\.(js)?bundle$/
won't match anything. If you want to match everything you should provide /.*/
instead. If you want only specific chunks I suggest to:
- Use
/* webpackChunkName: "myChunk" */
inimport()
- Set
localChunks: ['myChunk']
orlocalChunks: [/myChunk/]
from repack.
Also make sure you're building with dev=false
from Gradle. npx react-native webpack-bundle ...
works because you're passing --dev false
manually, but it looks like the build from Gradle is passing dev
as true
.
from repack.
Also make sure you're building with
dev=false
from Gradle.npx react-native webpack-bundle ...
works because you're passing--dev false
manually, but it looks like the build from Gradle is passingdev
astrue
.
let me double check again. And i will try to create a repro project.
Thanks for the swift response @zamotany
from repack.
@zamotany i can't make the repro yet but i just added a logger in the webpack config.
The build from Gradle is indeed on production mode.
I even manually disabled the hmr.
entry: [
...ReactNative.getInitializationEntries(reactNativePath, {
hmr: false,
}),
entry,
],
from repack.
I'm getting the same error in release builds. ( both android and iOS )
Description
It seems like the local chunks are not included in the apk.
When I inspect the iOS .app
file there is only a main.jsbundle
.
I have checked the dev
variable in the config and its false
.
Crashlytics stack trace:
Fatal Exception: com.facebook.react.common.c: ChunkLoadError: Loading chunk 9557 failed.
(resolution: 9557)
Versions:
repack: 2.5.1,
react-native: 0.65.1,
webpack: 5.65.0,
from repack.
It seems like the local chunks are not included in the apk.
Have you specified localChunks
property in OutputPlugin
in your Webpack config?
from repack.
I think so...
new ReactNative.OutputPlugin({
platform,
devServerEnabled: devServer.enabled,
remoteChunksOutput: path.join(__dirname, "build", platform, "remote"),
localChunks: /\.chunk\.(js)?bundle$/,
}),
from repack.
Maybe I should have mentioned that we use monorepo and we have multiple targets/flavors.
from repack.
@zamotany how to generate the apk and the ipa to include the local chunks
from repack.
Local chunks should be included in the apk/ipa by default. Are you getting any errors?
from repack.
I have the same problem
after setting localChunks
to [/.*/]
it seems the chunks make their way into the apk, but it seems to me that despite using webpackChunkName
in import()
, and using chunkFilename: '[name].chunk.bundle',
in webpack config, chunks still get named randomly (like 462.chunk.bundle
)
So it fails
I get a different error in logs though:
'ChunkManager.resolveChunk error:', 'No remote chunk resolver was provided. Did you forget to add `ChunkManager
.configure({ resolveRemoteChunk: ... })`?'
from repack.
Related Issues (20)
- Getting error "ReferenceError: Property 'CssSyntaxError' doesn't exist" while using styled-component. HOT 3
- [email protected] @callstack/repack/commands error HOT 3
- Can someone give me idea or tutorial how can i deploy my webpack bundle to local servers HOT 1
- Android Error when navigate Between MFEs HOT 9
- cannot load mini app(Module Federation) when verifyScriptSignature = 'strict' HOT 8
- Can't find variable: __wepack_require__ in ScriptManager.js HOT 10
- Unable to load script. Make sure you're either running Metro HOT 3
- Facing issue while implementing Offline Bundling. HOT 5
- Error in bundling micro apps with react-native-svg packages HOT 3
- [RFC] Override `start` command in `react-native.config.js` HOT 8
- Unhandled error in Webpack Compiler when doing `rpm run ios` HOT 2
- Cannot Resole React Hook Form correctly HOT 7
- repack monorepo deployment help
- Android is crashing when "onMessage" props is accessed in "react-native-webview" library HOT 1
- [RFC] sync API HOT 10
- Improve types for `prefetchScript` and `loadScript` HOT 3
- Is it possible to load a remote module before it is requested by the user?
- callstack_repack-Swift.h file not found HOT 11
- Repack app fails with "could not find react-redux context value" for the latest versions of react-redux and @reduxjs/toolkit HOT 3
- Property 'HMRClient' doesn't exist HOT 4
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.