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

Convert command hanging on "Convert Document: Launching the page in chromium…" #42

Closed
damgot opened this issue Sep 25, 2019 · 15 comments
Assignees
Labels

Comments

@damgot
Copy link
Contributor

damgot commented Sep 25, 2019

Convert command hanging on "Convert Document: Launching the page in chromium…"

In a debug session, I've the following error :

rejected promise not handled within 1 second: Error
extensionHostProcess.js:783
stack trace: Error: 
	at 9.n.Document.<anonymous> (c:\Users\Damgot\.vscode\extensions\manuth.markdown-converter-3.0.1\MarkdownConverter\lib\extension.js:1:20209)
	at Generator.next (<anonymous>)
	at o (c:\Users\Damgot\.vscode\extensions\manuth.markdown-converter-3.0.1\MarkdownConverter\lib\extension.js:1:17480)

chromium was installed successfully

@manuth manuth self-assigned this Sep 25, 2019
@manuth manuth added the bug label Sep 25, 2019
@manuth
Copy link
Owner

manuth commented Sep 25, 2019

Hello @damgot
Are you sure you copied the whole stacktrace?
Thanks for reporting the issue

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

I can't reproduce the issue.
Could you please post some more information about the system you're running for me to set up a proper VM?
Also what command are you trying to execute?

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

Hello @manuth.

It's on a very new installation. I've installed VSCode + Markdown All In One, Plantuml, markdownlint, and markdownConverter.

I tried to convert a .md document with "Markdown: Convert Document" command. I had a pop-up to install chromium, select "Yes", download was successfull and then the pop-up stayed infinitely on "Convert Document: Launching the page in chromium…"

I try to restart VSCode, restart computer, Uninstall-reinstall MarkdownConverter (and downloand again chromium) but nothing works.

This short stack trace is all I have, sorry =S

My OS is Windows 10 Pro (10.0.18362) and the system is a x64.
VSCode version is 1.38.1.

Thanks for help

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

Please try the debug-build I've just created:
markdown-converter-3.0.1.vsix.zip

Do you see any useful information in the stack trace?
You should get concrete line-numbers now.

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

It seems to be well installed because I saw command in the command palette, but I've the error : "command 'markdownConverter.Convert' not found" =S

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

Thank you, this helped me finding the issue.
Could you please go and try this new build?
markdown-converter-3.0.1.vsix.zip

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

Ok now I've this :

rejected promise not handled within 1 second: Error
extensionHostProcess.js:783
stack trace: Error: 
	at Document.<anonymous> (c:\Users\Damgot\.vscode\extensions\manuth.markdown-converter-3.0.1\MarkdownConverter\lib\System\Documents\Document.js:243:31)
	at Generator.next (<anonymous>)
	at fulfilled (c:\Users\Damgot\.vscode\extensions\manuth.markdown-converter-3.0.1\MarkdownConverter\lib\System\Documents\Document.js:5:58)

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

Alright now we're getting to something.
I'll go try to find out what's goint wrong for you ^^

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

Ok I've found it...

As it was a new install, I've simply copy past the JSON settings... But the path of my stylesheet in this new install was not exactly the same than before.
With the correct path everything works fine.

The bug was on my side.
But for enhancement, a error pop-up like "Missing stylesheet" or something like that could be useful ^^

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

The problem was there :

for (let styleSheet of this.StyleSheets) {
                if (/.*:\/\//g.test(styleSheet) || !Path.isAbsolute(styleSheet)) {
                    styleCode += Dedent(`<link rel="stylesheet" type="text/css" href="${styleSheet}" />\n`);
                }
                else {
                    if (yield FileSystem.pathExists(styleSheet)) {
                        styleCode += "<style>" + (yield FileSystem.readFile(styleSheet)).toString() + "</style>\n";
                    }
                    else {
                        throw new FileException_1.FileException(null, styleSheet);
                    }
                }
            }

At this line :
throw new FileException_1.FileException(null, styleSheet);

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

Well that's pretty strange anyway, I thought my exception-handling covers all possible exceptions- I'll have a look at it asap.

But please don't blame me if it takes 2 days or 3 - I have a lot exams this week.

@damgot
Copy link
Contributor Author

damgot commented Sep 25, 2019

There is no problem.
My issue is solved, it works, take your time to look at this :).

Many thanks for helping me solve my problem :)

@manuth
Copy link
Owner

manuth commented Sep 25, 2019

You're welcome mate 😄

@manuth
Copy link
Owner

manuth commented Sep 26, 2019

Alright so I finally could find what's causing the error.

page.on(
"request",
async (request) =>
{
if (request.url() === this.URL)
{
await request.respond(
{
body: await this.Document.Render()
});
}
else
{
await request.continue();
}
});

The async (request) => { } portion of the code is not executed in a separate Promise-chain which causes this empty-looking stacktrace.

I could resolve this issue by moving the this.Document.Render() portion out of said page.on("request")-scope.

I'll publish another new release this evening.

@manuth manuth closed this as completed in 02b0d32 Sep 26, 2019
@damgot
Copy link
Contributor Author

damgot commented Sep 27, 2019

Tested and approved :).

Thanks a lot

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

No branches or pull requests

2 participants