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

fix(nuxt): use lodash.template directly to compile templates #1525

Merged
merged 2 commits into from
Jul 13, 2024

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented May 3, 2024

We are going to be removing support for compiling templates from disk using lodash.template in Nuxt v4. This is a PR to move lodash usage directly into vuefire's Nuxt module.

It would also be possible to avoid using it entirely, which I would strongly recommend, either:

@danielroe danielroe changed the title fix(nuxt): use lodash.template directly to compile template fix(nuxt): drop implicit usage of lodash.template for compiling template May 3, 2024
@danielroe danielroe changed the title fix(nuxt): drop implicit usage of lodash.template for compiling template fix(nuxt): use lodash.template directly to compile templates May 3, 2024
@santiagoaloi
Copy link

santiagoaloi commented Jul 2, 2024

I encountered this issue while installing the VueFire/Nuxt module.
This problem occurs specifically when using compatibilityVersion: 4.

Package Versions

"@firebase/app-types": "^0.9.2",
"firebase": "^10.12.2",
"firebase-admin": "^12.2.0",
"firebase-functions": "^5.0.1"

Environment Details

- Operating System: Darwin
- Node Version:     v22.2.0
- Nuxt Version:     3.12.2
- CLI Version:      3.12.0
- Nitro Version:    2.9.7
- Package Manager:  [email protected]
- Builder:          -
- User Config:      future, modules, extends, components, vuefire
- Runtime Modules:  [email protected]
- Build Modules:    -

Temporary Workaround

To address the issue temporarily, you can use the following configuration:

export default defineNuxtConfig({
  future: {
    compatibilityVersion: 4,
  },

  experimental: {
    compileTemplate: true,
  },

})

Note: This workaround is effective for version 3 only. Version 4 will not be reversible.

Additional Information

It appears that the pending merge of #1545 will resolve this compatibility conflict.

@posva
Copy link
Member

posva commented Jul 13, 2024

Thank you Daniel! I should indeed migrate out from templates and split the plugin into multiple ones that are conditionally added by the module. For anybody else wanting to contribute, feel free to open a new PR that split the two plugins with an ejs extension.

@posva posva merged commit f62ba9c into vuejs:main Jul 13, 2024
1 of 4 checks passed
@danielroe danielroe deleted the template-compilation branch July 13, 2024 10:46
@posva
Copy link
Member

posva commented Jul 13, 2024

Apparently this requires the user to install lodash-es so I think I will release once the plugins are split and no templates are used

@danielroe
Copy link
Member Author

It adds lodash-es to the dependencies. Why would the user need to install it?

@posva
Copy link
Member

posva commented Jul 13, 2024

I was as confused as you. Maybe it was because I tried yalc instead of using npm pack.

Edit: it works when packing, so I published the new versions

@danielroe
Copy link
Member Author

Whew. Thanks for the heads up about yalc 🙏

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

Successfully merging this pull request may close these issues.

None yet

3 participants