pug-php / pug

Pug template engine for PHP
https://www.phug-lang.com
MIT License
387 stars 42 forks source link

[Bug Report] Periods in Path Causes Many Errors #173

Closed MikeDombo closed 6 years ago

MikeDombo commented 6 years ago

Hi, I was deploying an update to my production server that is running on Windows and has a period in the path. It looks like C:\xampp\htdocs\MikeDombrowski.com\... and I found that when accessing pages rendered with Pug I got errors like "file not found" until I specified the entire path to the pug file. Usually a relative path works fine. Then even more errors like "unknown mixin" and "undefined variable".

Ultimately I found that I had to change the path to remove the period. It might be a windows only problem, but that would surprise me. I assume that your code is somehow treating the period in a path differently in some way.

kylekatarnls commented 6 years ago

Yes it may have been detected as an extension, I will check that.

kylekatarnls commented 6 years ago

Hi, I ran the unit tests on Windows, and several directories in my path contains periods and all tests succeed. Can you give me more context like a minimal example to reproduce the bug. path example, PHP used with options and a template that fails.

Most of all, do you have custom file resolver/custom include/events hooks over the default way to retrieve templates?

MikeDombo commented 6 years ago

Hi, I recreated the circumstances on my local computer and found that I could not reproduce the problem. I'm not sure why it did not work on my production server or why removing the period fixed it, but since neither of us can reproduce, I'll close the issue.

kylekatarnls commented 6 years ago

I can suspect some obsolete cache problem where the renaming of the directory invalided the cache. But not sure and I can't say if it's the pug cache or another.