glromeo / esbuild-sass-plugin

esbuild plugin for sass
MIT License
155 stars 40 forks source link

Infinity loop on Windows when loading modules paths #189

Closed jcoqueret closed 3 weeks ago

jcoqueret commented 1 month ago

Hi,

I am running the sass plugin version 3.3.1 on Windows. When executing my build, the process gets stuck in the plugin by a infinite loop inside the modulesPaths function.

The problem occurs because the path variable doesn't contain the ending '/' while the root variable does.

Here a simple project to reproduce the issue: esbuild-sass-plugin-issue.zip

And here is the output of that script:

Path: C:\temp\folder\subfolder\other-subfolder - Root: C:\
Path: C:\temp\folder\subfolder - Root: C:\
Path: C:\temp\folder - Root: C:\
Path: C:\temp - Root: C:\
Path: C: - Root: C:\
Path: C:\temp\folder\subfolder\other-subfolder - Root: C:\
Path: C:\temp\folder\subfolder - Root: C:\
Path: C:\temp\folder - Root: C:\
Path: C:\temp - Root: C:\
Path: C: - Root: C:\
dungjk commented 4 weeks ago

Hello @jcoqueret Thank you for your report.

I've run your code but didn't encounter the issue. This may happen on certain versions of Node.js. Could you please provide more information about your Node.js version and OS version?

Path: D:\temp\folder\subfolder\other-subfolder - Root: D:\
Path: D:\temp\folder\subfolder - Root: D:\
Path: D:\temp\folder - Root: D:\
Path: D:\temp - Root: D:\

Thanks!

jcoqueret commented 3 weeks ago

Hi, I was running the version 23.0.0 when I got that issue. I tried on version 23.1.0 and 22.11.0 and it looks all good.

Thank you to figure it out where the issue was. I'll close that issue.