Closed Fir3st closed 5 years ago
I found it's similar to https://github.com/nuxt-community/nuxt-i18n/issues/151, when I set seo
to false
, it works fine.
@Fir3st I think it's not TypeScript related, this is more likely an issue with page meta (vue-meta
) being overriden at some moment.
And please provide a ready reproduction repository, not something where steps are installing packages, create or moving files.
@kevinmarrec Ok, I've created example repository https://github.com/Fir3st/nuxt-i18n-test with two branches: master
and javascript
where javascript branch is equivalent to master
branch. When you use plain js version, it works fine, but with Typescript (even with plain js page declaration) it causes the issue. And as I wrote before, if you set seo
to false
, it works fine.
@Fir3st I can confirm that typescript version has the problem while javascript doesn't but I don't know why.
That said, seo = true
is pure evil and I'm hoping it will be disabled by default in next major version - #346
Also, while I don't know where the difference in behavior comes from, it might be fixed in latest vue-meta version, I feel. Nuxt is not using vue-meta@2 yet though, so it's hard to test. @pimlie might be interested in this problem.
Probably similar as reported here? https://github.com/nuxt/vue-meta/issues/396
Thats fixed in vue-meta v2.0.4. Although nuxt will print a warning about a not recommended version, its fine to ignore that warning (note: there is only one breaking change with regards to boolean attributes). So feel free to test vue-meta v2 in your project and report any errors in the vue-meta repo. Thanks!
@Fir3st @rchl
Will check it out but yeah I'm confused too, TypeScript becomes JavaScript at Webpack build step (ts-loader
), so runtime should be same in both TS & JS, really weird that there would be in a issue only with TS.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@Fir3st I've updated your project to work with latest Nuxt (https://github.com/rchl/bugs-nuxt-i18n-typescript-title ) and it works for me there without problems now. So problem seems fixed.
As a side note, AFAIK this is something that has been fixed through vue-meta@2
that is shipped since Nuxt 2.9. https://github.com/nuxt/vue-meta/issues/396#issuecomment-504674486
Version
v5.3.0
Reproduction link
https://nuxtjs.org/examples/typescript
Steps to reproduce
What is expected ?
The package should work without side effects
What is actually happening?
When message/notification disappears, page's title is deleted
Additional comments?
I know, it's weird, and my first thoughts were that's the problem of UI library, but I've tested 3 of them and the problem still persists. When I removed the package from modules, it worked fine. It works fine also for vanilla nuxt project (without TypeScript).