Code Monkey home page Code Monkey logo

electron-ejs's People

Contributors

gadhagod avatar gamelaster avatar jmjuanes avatar themaverickprogrammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

electron-ejs's Issues

Can't include layout

Hi all. I have a .ejs file look like this

<%- include('user.header'); -%>

<h1>
    Title
</h1>
<p>
    My page
</p>
<%- include('user.footer'); -%>

after running the app I am getting error look like this
Could not find the include file "user.header" at getIncludePath (/var/www/desktop-electron/node_modules/ejs/lib/ejs.js:162:13)

In my main.js I have a code look like this

function showTemplate(template) {
    mainWindow.loadURL(url.format({
        pathname: path.join(__dirname, APP.TemplatesPath, template),
        protocol: 'file:',
        slashes: true
    }));
}
showTemplate('user.dashboard.ejs')l

Please fix BUG))

Your package have conflict with win.webContents.openDevTools() function I had big headache with that until I get that it's because of module,when I make it comment there is no error, but when I try to run app with both it gives error with code ENNOENT and can't find a lot of files.

Loading partials does not work

I am loading the relative path in the app this way

// load the app first page
const url = `file://${__dirname}/../views/pages/mapping.ejs`
win.loadURL(url)

Without partials it works fine, with partials in the EJS script, File Not Found exceptions are thrown and bubble up the app. I have tried passing the relative directory into the EJS scripts and loading the partials that way with no luck.

TypeError: Cannot read properties of undefined (reading 'on')

[0] /Users/aarav/Downloads/codingshit/ACROMAXX/node_modules/.pnpm/[email protected]/node_modules/electron-ejs/index.js:30
[0]     app.on("ready", function () {
[0]         ^
[0] 
[0] TypeError: Cannot read properties of undefined (reading 'on')
[0]     at new ElectronEjs (/Users/aarav/Downloads/codingshit/ACROMAXX/node_modules/.pnpm/[email protected]/node_modules/electron-ejs/index.js:30:9)
[0]     at file:///Users/aarav/Downloads/codingshit/ACROMAXX/src/index.js:23:11

this has been happening with alot of electron packages recently, idk why, ive been trying to fix this for so long, no luck.

Can not pass data

Hi all. I am trying to pass data to inluced ejs tempalte.So in my main.js I have a code look like this

sendPostRequest('GET', 'user/get_accounts', {}, function (res) {
        res = JSON.parse(res);
        if (res.status === true) {

            var accounts = res.result.accounts;
            var currencies = res.result.currencies;

            var ejs = new electronEjs({accounts:accounts,currencies:currencies,a:'A'});

            showTemplate(APP.Templates.Account);
        }
    }, true); 
function showTemplate(template) {
    mainWindow.loadURL(url.format({
        pathname: path.join(__dirname, APP.TemplatesPath, template),
        protocol: 'file:',
        slashes: true
    }));
}

But after running app I am getting an error look like this

Uncaught Exception:
ReferenceError: /var/www/desktop-electron/templates/user/accounts.ejs:2
    1| <%- include('header'); -%>
 >> 2| <p><%= a %></p>
    3| <%- include('footer'); -%>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.