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: tag.innerHTML.replace is not a function when no module config is provided #350

Closed
cernymatej opened this issue Nov 21, 2023 · 3 comments Β· Fixed by #351
Closed

fix: tag.innerHTML.replace is not a function when no module config is provided #350

cernymatej opened this issue Nov 21, 2023 · 3 comments Β· Fixed by #351
Assignees
Labels
bug Something isn't working

Comments

@cernymatej
Copy link

πŸ› The bug

When the fontMetrics configuration is omitted in nuxt.config.ts, pages fail to render with the following error:
[500] tag.innerHTML.replace is not a function.

πŸ› οΈ To reproduce

https://stackblitz.com/edit/github-rbztbr?file=nuxt.config.ts

🌈 Expected behaviour

No error should be thrown in the absence of fontMetrics in nuxt.config.ts

ℹ️ Additional context

No response

@cernymatej cernymatej added the bug Something isn't working label Nov 21, 2023
Copy link
Collaborator

This is likely this upstream bug: unjs/unhead#278.

@harlan-zw
Copy link

harlan-zw commented Nov 21, 2023

The main issue is fixed upstream in Unhead 1.8.6.

There are a couple of interesting issues here:

  1. There is a bug where an empty string for children will be converted to true, this is because it's inheriting the behavior of the attribute properties.
  2. This is only a bug with children which is marked as deprecated, you should use innerHTML. The value for css is empty and it's still being provided to useHead, while this is valid it's not recommended. https://github.com/nuxt-modules/fontaine/blob/main/src/module.ts#L160

I'm going to fix #1 and will send a PR for #2 for tomorrow if you haven't done so before then

Copy link
Collaborator

I think this should be fixed in fontaine now πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants