spiritix/php-chrome-html2pdf

Error thrown if space is in project directory

realjay007 opened this issue · 1 comments

Hi.

When running the code, either via unit tests and actual usage, it fails if there is a space in the project directory.

Spiritix\Html2Pdf\ConverterException: Binary error: internal/modules/cjs/loader.js:969
  throw err;
  ^

Error: Cannot find module '/Users/juliusijie/Projects/Open'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}


/Users/juliusijie/Projects/Open Source/php-chrome-html2pdf/src/Spiritix/Html2Pdf/Converter.php:188
/Users/juliusijie/Projects/Open Source/php-chrome-html2pdf/tests/php/ConverterTest.php:61

In this case, it attempts to run the command: node /Users/juliusijie/Projects/Open Source/php-chrome-html2pdf/src/Spiritix/Html2Pdf/../../../index -o '{"printBackground":false}' but the node executable throws an error because of the space within the base directory name.

Thanks for the fix, merged