paullecam / react-native-electron Goto Github PK
View Code? Open in Web Editor NEWElectron extensions to React Native for Web
License: MIT License
Electron extensions to React Native for Web
License: MIT License
┏ Renderer -------------------
AttachConsole failed with error 6: Identificador inv�lido.
┗ ----------------------------
┏ Main -----------------------
Hash: e3d4ceea5d74c8613e4d
Version: webpack 4.43.0
Time: 1273ms
Built at: 14/04/2023 15:54:38
Asset Size Chunks Chunk Names
main.js 43.7 KiB main [emitted] main
Entrypoint main = main.js
[0] multi ./node_modules/electron-webpack/out/electron-main-hmr/main-hmr ./electron/main/index.js 40 bytes {main} [built]
[./electron/main/index.js] 1000 bytes {main} [built]
[./node_modules/electron-webpack/out/electron-main-hmr/main-hmr.js] 582 bytes {main} [built]
[electron] external "electron" 42 bytes {main} [built]
[electron-webpack/out/electron-main-hmr/HmrClient] external "electron-webpack/out/electron-main-hmr/HmrClient" 42 bytes {main} [built]
[path] external "path" 42 bytes {main} [built]
[source-map-support/source-map-support.js] external "source-map-support/source-map-support.js" 42 bytes {main} [built]
[url] external "url" 42 bytes {main} [built]
┗ ----------------------------
┏ Renderer -------------------
× 「wds」: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module.rules[0].resolve has an unknown property 'fullySpecified'. These properties are valid:
object { alias?, aliasFields?, cachePredicate?, cacheWithContext?, concord?, descriptionFiles?, enforceExtension?, enforceModuleExtension?, extensions?, fileSystem?, mainFields?, mainFiles?, moduleExtensions?, modules?, plugins?, resolver?, symlinks?, unsafeCache?, useSyncFileSystemCalls? }
-> Options for the resolver
┗ ----------------------------
Renderer WDS exited with code 1
Error: Renderer WDS exited with code 1
at ChildProcess.<anonymous> (C:\Users\familia\www\frontend-native\heat-react-native\node_modules\electron-webpack\src\dev\ChildProcessManager.ts:62:32)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Hi and thank you for you work !
My app is working very well when i run it from command lines, but I can't find a way to distribute it.
I tried to use prebuild binaries from here : https://github.com/electron/electron/releases and I spent several days trying to make it work playing with appropriate settings for react-native, but I can only get a blank electron window (index.html is displayed, and if I write something inside (in html) I can see it on screen, but not the react / react-native content)...
No success either with electron-forge, electron-builder, electron-packager...
Were you able to distribute an app with this extension ? If yes, could you explain how ?
Thank you again, cheers.
Will this package allow me to use modules like npm bonjour package which is a nodejs or electron module. I am looking for a solution that will allow me to use npm packages that are node support natively with react native
Use IntersectionObserver for onChangeVisibleRows()
Some handlers could be implemented using Chromium APIs:
onScroll()
onContentSizeChange()
(experimental in Chromium 55)hello dear,
Whenever I am importing import { StackNavigator } from 'react-navigation';
it showing following errors. Please help me out How can use this library....Thanks in advance
ERROR in ./node_modules/react-navigation/src/views/TabView/TabView.js
Module parse failed: Unexpected token (10:22)
You may need an appropriate loader to handle this file type.
|
| class TabView extends React.PureComponent {
| static defaultProps = {
| lazy: true,
| removedClippedSubviews: true,
@ ./node_modules/react-navigation/src/react-navigation.js 84:11-45
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/navigators/SwitchNavigator.js
Module parse failed: Unexpected token (11:13)
You may need an appropriate loader to handle this file type.
|
| const navigator = createNavigator(router, routeConfigMap, switchConfig)(
| props => <SwitchView {...props} />
| );
|
@ ./node_modules/react-navigation/src/react-navigation.js 26:11-50
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/CardStack/Card.js
Module parse failed: Unexpected token (12:6)
You may need an appropriate loader to handle this file type.
| const { children, pointerEvents, style } = this.props;
| return (
| <Animated.View
| pointerEvents={pointerEvents}
| ref={this.props.onComponentRef}
@ ./node_modules/react-navigation/src/react-navigation.js 57:11-44
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/CardStack/CardStackTransitioner.js
Module parse failed: Unexpected token (13:22)
You may need an appropriate loader to handle this file type.
|
| class CardStackTransitioner extends React.Component {
| static defaultProps = {
| mode: 'card',
| };
@ ./node_modules/react-navigation/src/react-navigation.js 51:11-61
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Drawer/DrawerView.js
Module parse failed: Unexpected token (13:8)
You may need an appropriate loader to handle this file type.
| */
| export default class DrawerView extends React.PureComponent {
| state = {
| drawerWidth:
| typeof this.props.drawerWidth === 'function'
@ ./node_modules/react-navigation/src/react-navigation.js 76:11-47
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Header/HeaderBackButton.js
Module parse failed: Unexpected token (14:22)
You may need an appropriate loader to handle this file type.
|
| class HeaderBackButton extends React.PureComponent {
| static defaultProps = {
| pressColorAndroid: 'rgba(0, 0, 0, .32)',
| tintColor: Platform.select({
@ ./node_modules/react-navigation/src/react-navigation.js 71:11-53
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/createNavigationContainer.js
Module parse failed: Unexpected token (16:9)
You may need an appropriate loader to handle this file type.
| export default function createNavigationContainer(Component) {
| class NavigationContainer extends React.Component {
| subs = null;
|
| static router = Component.router;
@ ./node_modules/react-navigation/src/react-navigation.js 6:11-49
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/navigators/DrawerNavigator.js
Module parse failed: Unexpected token (17:2)
You may need an appropriate loader to handle this file type.
|
| const defaultContentComponent = props => (
| <ScrollView alwaysBounceVertical={false}>
| <SafeAreaView forceInset={{ top: 'always', horizontal: 'never' }}>
| <DrawerItems {...props} />
@ ./node_modules/react-navigation/src/react-navigation.js 32:11-50
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/navigators/TabNavigator.js
Module parse failed: Unexpected token (17:25)
You may need an appropriate loader to handle this file type.
| const TabNavigator = (routeConfigs, config = {}) => {
| // Use the look native to the platform by default
| const mergedConfig = { ...TabNavigator.Presets.Default, ...config };
| const {
| tabBarComponent,
@ ./node_modules/react-navigation/src/react-navigation.js 29:11-47
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/SwitchView/SwitchView.js
Module parse failed: Unexpected token (18:6)
You may need an appropriate loader to handle this file type.
|
| return (
| <SceneView
| component={ChildComponent}
| navigation={childNavigation}
@ ./node_modules/react-navigation/src/react-navigation.js 95:11-51
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/TabView/TabBarBottom.js
Module parse failed: Unexpected token (23:22)
You may need an appropriate loader to handle this file type.
| class TabBarBottom extends React.PureComponent {
| // See https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/UIKitUICatalog/UITabBar.html
| static defaultProps = {
| activeTintColor: '#3478f6', // Default active tint color in iOS 10
| activeBackgroundColor: 'transparent',
@ ./node_modules/react-navigation/src/react-navigation.js 90:11-50
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Drawer/DrawerNavigatorItems.js
Module parse failed: Unexpected token (29:2)
You may need an appropriate loader to handle this file type.
| drawerPosition,
| }) => (
| <View style={[styles.container, itemsContainerStyle]}>
| {items.map((route, index) => {
| const focused = activeItemKey === route.key;
@ ./node_modules/react-navigation/src/react-navigation.js 79:11-57
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Header/Header.js
Module parse failed: Unexpected token (32:22)
You may need an appropriate loader to handle this file type.
|
| class Header extends React.PureComponent {
| static defaultProps = {
| leftInterpolator: HeaderStyleInterpolator.forLeft,
| leftButtonInterpolator: HeaderStyleInterpolator.forLeftButton,
@ ./node_modules/react-navigation/src/react-navigation.js 65:11-43
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/navigators/StackNavigator.js
Module parse failed: Unexpected token (41:6)
You may need an appropriate loader to handle this file type.
| const navigator = createNavigator(router, routeConfigMap, stackConfig)(
| props => (
| <CardStackTransitioner
| {...props}
| headerMode={headerMode}
@ ./node_modules/react-navigation/src/react-navigation.js 23:11-49
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/routers/StackRouter.js
Module parse failed: Unexpected token (51:30)
You may need an appropriate loader to handle this file type.
|
| const initialChildRouter = childRouters[initialRouteName];
| const pathsByRouteNames = { ...stackConfig.paths } || {};
| let paths = [];
|
@ ./node_modules/react-navigation/src/react-navigation.js 37:11-43
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/StateUtils.js
Module parse failed: Unexpected token (51:6)
You may need an appropriate loader to handle this file type.
|
| return {
| ...state,
| index: routes.length - 1,
| routes,
@ ./node_modules/react-navigation/src/react-navigation.js 9:11-34
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/routers/TabRouter.js
Module parse failed: Unexpected token (56:14)
You may need an appropriate loader to handle this file type.
| const childAction = NavigationActions.init();
| return {
| ...tabRouter.getStateForAction(childAction),
| key: routeName,
| routeName,
@ ./node_modules/react-navigation/src/react-navigation.js 40:11-41
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/routers/SwitchRouter.js
Module parse failed: Unexpected token (56:8)
You may need an appropriate loader to handle this file type.
| const childAction = NavigationActions.init();
| return {
| ...childRouter.getStateForAction(childAction),
| key: routeName,
| routeName,
@ ./node_modules/react-navigation/src/react-navigation.js 43:11-44
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/CardStack/CardStack.js
Module parse failed: Unexpected token (69:21)
You may need an appropriate loader to handle this file type.
| * corresponding location for the touch.
| */
| _gestureStartValue = 0;
|
| // tracks if a touch is currently happening
@ ./node_modules/react-navigation/src/react-navigation.js 54:11-49
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Header/HeaderTitle.js
Module parse failed: Unexpected token (6:30)
You may need an appropriate loader to handle this file type.
| const AnimatedText = Animated.Text;
|
| const HeaderTitle = ({ style, ...rest }) => (
| <AnimatedText
| numberOfLines={1}
@ ./node_modules/react-navigation/src/react-navigation.js 68:11-48
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/Transitioner.js
Module parse failed: Unexpected token (78:6)
You may need an appropriate loader to handle this file type.
| _startTransition(nextProps, nextScenes, indexHasChanged) {
| const nextState = {
| ...this.state,
| scenes: nextScenes,
| };
@ ./node_modules/react-navigation/src/react-navigation.js 48:11-42
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/TabView/TabBarTop.js
Module parse failed: Unexpected token (7:22)
You may need an appropriate loader to handle this file type.
|
| export default class TabBarTop extends React.PureComponent {
| static defaultProps = {
| activeTintColor: '#fff',
| inactiveTintColor: '#fff',
@ ./node_modules/react-navigation/src/react-navigation.js 87:11-47
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/withNavigation.js
Module parse failed: Unexpected token (7:23)
You may need an appropriate loader to handle this file type.
| export default function withNavigation(Component) {
| class ComponentWithNavigation extends React.Component {
| static displayName = `withNavigation(${Component.displayName ||
| Component.name})`;
|
@ ./node_modules/react-navigation/src/react-navigation.js 100:11-44
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/views/withNavigationFocus.js
Module parse failed: Unexpected token (8:23)
You may need an appropriate loader to handle this file type.
| export default function withNavigationFocus(Component) {
| class ComponentWithNavigationFocus extends React.Component {
| static displayName = `withNavigationFocus(${Component.displayName ||
| Component.name})`;
|
@ ./node_modules/react-navigation/src/react-navigation.js 103:11-49
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/addNavigationHelpers.js
Module parse failed: Unexpected token (8:4)
You may need an appropriate loader to handle this file type.
| export default function(navigation) {
| return {
| ...navigation,
| goBack: key => {
| let actualizedKey = key;
@ ./node_modules/react-navigation/src/react-navigation.js 12:11-44
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-native-safe-area-view/index.js
Module parse failed: Unexpected token (98:28)
You may need an appropriate loader to handle this file type.
|
| class SafeView extends Component {
| static setStatusBarHeight = height => {
| _customStatusBarHeight = height;
| };
@ ./node_modules/react-navigation/src/react-navigation.js 60:11-49
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
ERROR in ./node_modules/react-navigation/src/navigators/createNavigator.js
Module parse failed: Unexpected token (9:20)
You may need an appropriate loader to handle this file type.
| return NavigationView => {
| class Navigator extends React.Component {
| static router = router;
| static navigationOptions = null;
|
@ ./node_modules/react-navigation/src/react-navigation.js 20:11-50
@ ./app/App.js
@ ./app/renderer.js
@ multi (webpack)-dev-server/client?http://localhost:7000 webpack/hot/dev-server ./app/renderer.js
I created an app that has redux store.
export default function App() { return ( <Provider store={store}> <PersistGate loading={<ActivityIndicator />} persistor={persistor}> <Root /> </PersistGate> </Provider> ) }
But it returns this error.
Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
How do i configure it properly?
nodeIntegration
is highly discouraged nowadays by Electron due to it's security holes. Hackers can access the user's whole machine because of this. It will be disabled by default on v5+.
Any way to disable this and still be able to communicate with Electron?
For example, maybe if Electron main process can access the webapp window
object via webContents.
Not sure if possible, but would be safer.
The only reason I have it enabled is to be able to use the Linking
API correctly with deep linking.
Perhaps I'm in the wrong place here, excuse me if I am. This may also be more of a question than an issue.
I also posted a stackoverflow question: https://stackoverflow.com/questions/50620640/electron-builder-tries-to-include-react-native-while-i-have-an-alias-set-in-webp
When I try yarn dist
as in
"compile": "electron-webpack",
"dist": "yarn compile && electron-builder",
it errors out with
Error: Unresolved node modules: react-native
at /media/dj/dev/scan-app-desktop/node_modules/electron-builder-lib/src/util/packageDependencies.ts:108:17
From previous event:
at Collector.resolveUnresolvedHoisted (/media/dj/dev/scan-app-desktop/node_modules/electron-builder-lib/src/util/packageDependencies.ts:164:10)
at /media/dj/dev/scan-app-desktop/node_modules/electron-builder-lib/src/util/packageDependencies.ts:82:18
at Generator.next (<anonymous>)
at runCallback (timers.js:763:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate (timers.js:716:5)
From previous event:
at Collector.collect (/media/dj/dev/scan-app-desktop/node_modules/electron-builder-lib/src/util/packageDependencies.ts:84:6)
at /media/dj/dev/scan-app-desktop/node_modules/electron-builder-lib/out/util/packageDependencies.js:123:47
at Generator.next (<anonymous>)
(...)
in my package.json I have the electronWebpack config:
"electronWebpack": {
"renderer": {
"webpackConfig": "webpack.renderer.additions.js"
}
},
and in webpack.renderer.additions.js:
const path = require('path')
const resolve = {
alias: {
'react-native': path.join(__dirname, 'node_modules/react-native-electron')
}
}
module.exports = {resolve}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.