Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No content but buttons, buttons aren't working, seems like index.html isn't being loaded #55

Closed
stepheneb opened this issue Feb 13, 2020 · 1 comment

Comments

@stepheneb
Copy link

Am trying to use electron-prompt to make a dialog with a numeric input.

Am getting this result.

image

After clicking either the button the only change appears to be that the background changes to white:

image
Environment:

node --version: 
v12.14.1
electron --version: 
v8.0.0
electron-forge --version: 
✔ Checking your system
6.0.0-beta.49

Code;

const promptOptions = {
  title: 'Run Bubble Sort example',
  label: 'ms delay:',
  // buttons: ['Cancel', 'Yes'],
  value: 10,
  inputAttrs: {
    type: 'number',
    // min: "1",
    // max: "1000"
  },
  type: 'input'
};

examples.promptRun = () => {
  const bw = BrowserWindow.getFocusedWindow();
  prompt(promptOptions, bw)
    .then((response) => {
      if (response === null) {
        // Cancel: button 0 clicked
      } else {
        examples.bubblesort();
      }
    })
    .catch(console.error);
};

I also noticed a strange problem where webpack gave an error when I tried to debug into the prompt code.

Attempting to step into:

image

I get this error:

Could not load content for webpack:///./node_modules/electron-prompt/lib/index.js : HTTP status code: 404

The only difference I noticed with other npm modules I could debug into is that index.js is in the lib dir. Others I could debug into index.js was one level higher.

image

I cloned electron-forge locally and moved index.js up one level (and the code in the page folder up one leve also) and change the code so index.js loads dependent resources form the lib directory.

With these changes I coulod step into prompt -- but all I got then was just a white window.

Thought I'd report the issues before I looked further.

@p-sam
Copy link
Owner

p-sam commented Feb 13, 2020

Duplicate of #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants