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

Breaking v3.x change #3260

Closed
niftylettuce opened this issue May 26, 2020 · 9 comments
Closed

Breaking v3.x change #3260

niftylettuce opened this issue May 26, 2020 · 9 comments
Labels

Comments

@niftylettuce
Copy link

It seems in v3.x that variables declared are no longer working and throwing errors...

✖  error     SyntaxError: Identifier 'isHelp' has already been declared
@niftylettuce
Copy link
Author

This is the line, it's at the top in layout.pug:

- const isHelp = ctx.pathWithoutLocale === '/help'

As soon as I upgraded to v3.x (with no other changes), the error appeared.

What's up here @ForbesLindesay?

@niftylettuce
Copy link
Author

@ForbesLindesay to reproduce, clone this repo, and then yarn add pug@latest -- then you'll notice this line is the culprit https://github.com/forwardemail/forwardemail.net/blob/4c4327ca1abe3153bd75ea376b41cab7f8cbbde2/app/views/layout.pug#L82 when you node web and then go to http://localhost:3000.

@tapz
Copy link

tapz commented May 27, 2020

I'm seeing this too. Should be mentioned in the breaking changes if this feature has been dropped.

@ForbesLindesay
Copy link
Member

This is odd. I'm not sure what's causing this. I'll have a go at debugging and see what I can do.

@ForbesLindesay
Copy link
Member

This is a regression in with. I should hopefully have a fix out later today.

@ForbesLindesay
Copy link
Member

Thank you for reporting this. If you update the "with" dependency to 7.0.1 it should now be fixed. You can do this in your lock file, as pug does not use exact versions.

@niftylettuce
Copy link
Author

No problem @ForbesLindesay I'll try the new version

@tapz
Copy link

tapz commented Jun 18, 2020

Any plans to release the fix to NPM?

@ForbesLindesay
Copy link
Member

@tapz it is released to npm. If you still have problems it means you have a cached dependency in your lock file. Update your lock file.

@pugjs pugjs locked as resolved and limited conversation to collaborators Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants