#Cannot find module [FIXED]

6 messages · Page 1 of 1 (latest)

brave salmon
#

Hello guys, im facing a few problems after i built the project.
the cannot find module newMessageHandler, axios, crypto
i tried using path.join(__dirname, 'events/newMessage.js'); but then i get error newMessage/axios/crypto is not a function
full code: https://github.com/DaYroXy/cryptwohale-desktop
of course i did install the dependencies 'npm i axios crypto etc...'

Main:

const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const newMessageHandler = require('./events/newMessage.js');
const axios = require('axios')
const crypto = require('crypto')
const isDev = !app.isPackaged;

viteConfig:

export default defineConfig({
  plugins: [react()],
  build: {
    outDir: 'dist',
  },
  base: './', // Set base to './'
});

Not really sure how to include events/* folder as well as the axios/crypto dependencies

GitHub

Contribute to DaYroXy/cryptwohale-desktop development by creating an account on GitHub.

crimson oracle
#

investigate if axio is compatible with electron, it turns out that something similar happened to me with another library and the problem was that it was not compatible

#

on the other hand, why don't you use axios on the render side?

brave salmon
#

Im trying to make it little bit more secure i dont want the request to show on the dev tools network i know i can disable dev tools but still its more secure

brave salmon
brave salmon
#

[Fixed]