Comments (14)
Note that a fresh project from
npx create-nextron-app my-app --example basic-lang-javascript-python
cd my-app
npm install && npm run dev
This exact set of command launch the app on my mac
from nextron.
@yt-dlx Hi, in this template, you can see how we send data from the frontend, to the js backend via IPC.
In that example:
- front the frontend, we send
window.ipc.send('run-sh', value)
via this ipc.send - and, in the backend, we receive the signal via ipcMain.on:
ipcMain.on('run-sh', async (event, value) => {
console.log('DEBUG: starting process') // for dev mode
event.sender.send('log', 'Running...') // for prod mode
await startProcess(event, value)
})
I hope it helps :)
from nextron.
what am i doing wrong? I cloned the example folder and ran 'yarn dev'
from nextron.
@yt-dlx doo you have preload.js
file inside the main folder?
that might be the cause, it is define and exposed in that file.
And when creating a windows, you should pass it like this:
mainWindow = createWindow('main', {
width: 1000,
height: 700,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
}
})
from nextron.
@bm777 in this version there was no preload.js 'https://github.com/saltyshiomix/nextron/tree/main/examples/basic-lang-javascript-python'
can i use the preload.js from the repo?
from nextron.
It should appear if you do:
npx create-nextron-app my-app --example basic-lang-javascript-python
If not, you can copy this preload.js and past it in your main/
from nextron.
I have tried with the preload.js but I am facing the same error.
Kindly please help me: https://github.com/yt-dlx/yt-dlx/tree/main/package
from nextron.
Instead of cloning to start your working directory, did you create a whole new project from npx create-nextron-app my-app --example basic-lang-javascript-python
? This will help greatly if you don't start from a clone.
from nextron.
@Psycokwet I tried with the yarn create but same error of window.ipc.
I have also tried the preload.js.
from nextron.
@yt-dlx Oh I got the issue:
There is a helper
folder missing. @Psycokwet is right, you didn't create the project with that template. if you did it, it would have automatically also created that folder. it seems, you are trying to integrate it into your project.
The missing folder is this ->
https://github.com/saltyshiomix/nextron/tree/651967d7df3d0f7cb306f7d4296866f994fbeb5d/examples/_template/js/main
from nextron.
I've implemented the changes using 'yarn create' as suggested, but the issue persists. Would you mind reviewing the details?
You can find the commit with the updates here: https://github.com/yt-dlx/yt-dlx/tree/main/package
from nextron.
If you really did start your project with npx create-nextron-app my-app --example basic-lang-javascript-python
You should have this file structure
But in your github example, I see that :
Those are differents, what did you do ?
You still miss at least scripts, but I would start anew instead of trying to fix an install made by hand
from nextron.
I followed these steps:
- npx create-nextron-app package --example basic-lang-javascript-python
- cd package
- npm install && npm run dev
Yet the same issues. window.ipc
Tested Environments:
Commit:
Note:
- I am able to run the code without IPC but not with IPC
- CodeSandBox
from nextron.
Thnks guys. I have fixed the issue using electron-vite
from nextron.
Related Issues (20)
- Next Ui Support HOT 1
- vscode debug not work
- Is there an example of next js app router ? I tried ,but failed. HOT 3
- Monorepo: "Next not found in both dependencies and devDependencies."
- Nextron js is completely broken - Everything does not seems to work anymore HOT 3
- Nextron exports the build results to "app" directory, so please set "distDir" to "../app" in next.config.js HOT 1
- Using next js 14 app router,When nodeIntegration set to true,the useEffect not trigger,
- Unable to Build Nextron HOT 2
- Different Directories for Different OS builds.
- ERR_TOO_MANY_REDIRECTS on fresh install
- Entry point?
- Pass next command line options
- examples/basic-launch-app-from-url is missing ./helpers HOT 1
- Add a Shadcn example
- Cannot build the installer file with output: 'standalone'.
- Middleware.ts does not trigger in nextron HOT 3
- showSaveDialogSync is not working
- eslint in folder renderer nextron
- Brief Blank Screen Before Next.js Page Content Loads
- electron.webContents.printToPDF not working with NextJS page
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 nextron.