NightlyCommit / twing

First-class Twig engine for Node.js
BSD 2-Clause "Simplified" License
199 stars 23 forks source link

Error: Unable to add global "country" as the extensions have already been initialized. #527

Closed ChandlerVS closed 11 months ago

ChandlerVS commented 4 years ago

Can someone explain how these class of errors appear? I have absolutely no idea how to keep this form happening. It happens once every so often to someone random in production and I can't figure out why.

How are the extensions being initialized? How can I ensure globals are added before extension initialization? I can't find any documentation on this.

If I need to post code for this explanation, please let me know.

liamtarpey commented 3 years ago

@ChandlerVS Having the exact same problem, would love some feedback on this! Did you find a solution?

ChandlerVS commented 3 years ago

@ChandlerVS Having the exact same problem, would love some feedback on this! Did you find a solution?

Unfortunately I did not have time to sit around and figure it out. I removed Twing from my project and used an engine that Express recommends.

ericmorand commented 11 months ago

So, there is no more limit to the moment we add a global with Twing@6. I would like to avoid changing the behaviour of Twing@5 at that point, but if it is really important please comment and I'll find a way.