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

Path problems on Windows #10

Closed
Niksac opened this issue Apr 27, 2022 · 8 comments
Closed

Path problems on Windows #10

Niksac opened this issue Apr 27, 2022 · 8 comments

Comments

@Niksac
Copy link

Niksac commented Apr 27, 2022

When using Windows, Nunjuck files will not compile unless in "watch" mode.
I tracked down the issue to be caused by the globby package which does not match for windows paths with backslashes.

Using this.from.path().replace(/\\/g, '/') as pattern for globby, will work as a workaround until the folks at globby fix it on their end.

What do you think?

@moyus
Copy link
Owner

moyus commented Apr 27, 2022

Didn't have a Windows computer to test such case, I will fix it in the next update version soon.

@moyus
Copy link
Owner

moyus commented Apr 28, 2022

@Niksac I have published a beta version laravel-mix-nunjucks@1.2.0-beta.1, could you please help me test whether it works now?

@Niksac
Copy link
Author

Niksac commented Apr 28, 2022

With your beta version, the Windows path issue is gone.

However, I needed to update the laravel-mix package because the laravel-mix/src/components/Component.js file, you now use in index.js was not present in my laravel-mix version (6.0.25).

The file is marked as @internal by the mix devs, so I would advise against referencing it for now.
Alternatively, the package.json should be upgraded to the new requirements.

@moyus
Copy link
Owner

moyus commented Apr 29, 2022

Try laravel-mix-nunjucks@1.2.0-beta.2, I think it could be the candidate release version.

@Niksac
Copy link
Author

Niksac commented Apr 29, 2022

Not working for me:
[webpack-cli] TypeError: Class constructor Nunjucks cannot be invoked without 'new'

Passing an instance when extending fixed it for me:
mix.extend("njk", new Nunjucks);

@moyus
Copy link
Owner

moyus commented Apr 29, 2022

Looks it's the last issue I need to fix.

@moyus
Copy link
Owner

moyus commented Apr 29, 2022

v1.2.0 has been published, the issue should be resolved.

@Niksac
Copy link
Author

Niksac commented Apr 29, 2022

v1.2.0 seems to work without issue on windows.
Thank you!

@Niksac Niksac closed this as completed Apr 29, 2022
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

2 participants