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

UI libraries delete page's title when TypeScript is used in project #342

Closed
Fir3st opened this issue Jun 26, 2019 · 9 comments
Closed

UI libraries delete page's title when TypeScript is used in project #342

Fir3st opened this issue Jun 26, 2019 · 9 comments

Comments

@Fir3st
Copy link

Fir3st commented Jun 26, 2019

Version

v5.3.0

Reproduction link

https://nuxtjs.org/examples/typescript

Steps to reproduce

  1. Create nuxt project with TypeScript
  2. Add any UI framework that supports notifications and messages (I've already tested AT UI, Element UI and Ant Design)
  3. Add framework into the project
  4. Put somewhere notification/message (like in my project, https://github.com/treevity/treevity/blob/antd-message/client/pages/login.vue)

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).

This bug report is available on Nuxt community (#c253)
@Fir3st
Copy link
Author

Fir3st commented Jun 26, 2019

I found it's similar to #151, when I set seo to false, it works fine.

@kevinmarrec
Copy link

@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.

@Fir3st
Copy link
Author

Fir3st commented Jul 3, 2019

@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.

@rchl
Copy link
Collaborator

rchl commented Jul 3, 2019

@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.

@pimlie
Copy link

pimlie commented Jul 3, 2019

Probably similar as reported here? nuxt/vue-meta#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!

@kevinmarrec
Copy link

@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.

@stale
Copy link

stale bot commented Sep 2, 2019

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.

@stale stale bot added the wontfix label Sep 2, 2019
@rchl
Copy link
Collaborator

rchl commented Sep 2, 2019

@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.

@rchl rchl closed this as completed Sep 2, 2019
@stale stale bot removed the wontfix label Sep 2, 2019
@kevinmarrec
Copy link

kevinmarrec commented Sep 3, 2019

As a side note, AFAIK this is something that has been fixed through vue-meta@2 that is shipped since Nuxt 2.9. nuxt/vue-meta#396 (comment)

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

No branches or pull requests

4 participants