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

Windows File Paths don't work in Input #226

Open
attapurposevc opened this issue Jul 30, 2018 · 5 comments
Open

Windows File Paths don't work in Input #226

attapurposevc opened this issue Jul 30, 2018 · 5 comments

Comments

@attapurposevc
Copy link

Hi everyone,

I'm having issues using windows file paths such as C:\Users\aUser\AppData\Local\Temp\stuff.html

The script fails silently and doesn't load anything in the pdf

@codecounselor
Copy link
Collaborator

If you're still having trouble please list the full command you're running and attach a sample html file.

@attapurposevc
Copy link
Author

attapurposevc commented Aug 24, 2018

I fixed it on my end. This was my hack if you are interested:
const htmlFileURL = (process.platform == 'win32') ? `file:\\/\\/${htmlFile.replace(/\\/g,"\\/")}` : htmlFile;

Basically, if it's on windows, the url parsing module assumes that your drive i.e. C:// is the protocol.

@codecounselor
Copy link
Collaborator

Thanks, that's interesting. I'll leave this issue open. Feel free to submit a PR if you'd like.

@MylesWardell
Copy link

This was confusing the hell out of me for too long. TY!

@codemanki
Copy link

@attapurposevc thank you for this hint!

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

4 participants