Can't make Haul to work together with Realm
See original GitHub issueCurrent Behavior
Compiling fails.
Expected Behavior
To compile.
Haul Configuration (webpack.haul.js)
Default.
Your Environment
| software | version |
|---|---|
| Haul | 1.0.0-beta.13 |
| react-native | 0.50.3 |
| node | 8.4.0 |
| yarn | 1.5.1 |
| realm | 2.2.13 |
Stacktrace:
./node_modules/realm/lib/index.js
102:27-55 Critical dependency: the request of a dependency is an expression
at CommonJsRequireContextDependency.getWarnings (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/dependencies/ContextDependency.js:39:18)
at Compilation.reportDependencyErrorsAndWarnings (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/Compilation.js:703:24)
at Compilation.finish (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/Compilation.js:561:9)
at applyPluginsParallel.err (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/Compiler.js:506:17)
at /Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/tapable/lib/Tapable.js:289:11
at _addModuleChain (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/Compilation.js:507:11)
at processModuleDependencies.err (/Users/ferrannp/Development/Projects/ReactNative/Showman/node_modules/webpack/lib/Compilation.js:477:14)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
@ ./node_modules/realm/lib/index.js
@ ./src/database/index.js
@ ./src/root.js
@ ./src/index.js
@ ./index.ios.js
@ multi ./node_modules/haul/src/utils/polyfillEnvironment.js ./index.ios.js
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Realm crashes on create when using Haul #2627 - GitHub
I am trying to get Realm working with Haul. It was working fine when I was using the react native packager but I'm...
Read more >Workaround if you can't see Realms invites (Java edition 1.18.2)
First try pressing F11 twice on the Realms screen. If that doesn't work: Turn Fullscreen off in Video Settings to switch to Windowed...
Read more >Minecraft Realms Plus Troubleshooting – Home
This article provides general troubleshooting for connection issues for Minecraft Realms Plus. For information on Minecraft: Java Edition Realms multiplayer ...
Read more >Realm - Can't create object with existing primary key value
When you call realm.create(Dog.self, value:dog, update: true) , if an object with ... keys since you can use the Realm.object(ofType:forPrimaryKey:) method:
Read more >Playing on a Realm in both Java and Win10 - Arqade
If you are playing not on a Realm, but on a Java Edition Spigot server, there have been packet translators already made, like...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As far as I know, the Webpack does not support dynamic require except using
require.context(non-standard) and with Webpack 4 there should be support for dynamic import. I think you need to open issue in Realm repo to support Webpack, there is nothing Haul can do about this. But hey, I am no expert here 😃Edit: Or perhaps webpack.ContextReplacementPlugin plugin could do some good, but haven’t used that yet.
@Exulansis you can configure the
babel-loaderto parse realm, by default I think it skips node modules, just do so in yourwebpack.haul.js. Provided you have the right transforms in your babelrc it should work.