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

Issue on the props definition after update from 2.7.10 to 2.7.11 #12821

Closed
carvemerson opened this issue Oct 11, 2022 · 2 comments
Closed

Issue on the props definition after update from 2.7.10 to 2.7.11 #12821

carvemerson opened this issue Oct 11, 2022 · 2 comments

Comments

@carvemerson
Copy link

Version

2.7.11

Reproduction link

codesandbox.io

Steps to reproduce

After update the vue version from 2.7.10 to 2.7.11 the below prop declaration do not work anymore:

props: {
    btnEditName: {
        type: String,
        required: false,
        default () {
            return this.$t('ui.common.edit');
        },
    },
}

Here is the error that I get on the browser:

vendor.js?id=1e442c890616af120be86f4594f164b7:2 TypeError: Cannot read properties of undefined (reading '_t')
at I.t.$t (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:558340)
at a.default (app.js?id=76bc79b9d368bc3b9486130d861347b7:2:153982)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692078
at qr (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692088)
at o (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695159)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695222
at t._init (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695235)
at new a (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692574)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:685664
at init (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:685695)

I rolledback to the version 2.7.10, and all works fine.

What is expected?

Declare a prop like

props: {
    btnEditName: {
        type: String,
        required: false,
        default () {
            return this.$t('ui.common.edit');
        },
    },
}

What is actually happening?

This error:

vendor.js?id=1e442c890616af120be86f4594f164b7:2 TypeError: Cannot read properties of undefined (reading '_t')
at I.t.$t (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:558340)
at a.default (app.js?id=76bc79b9d368bc3b9486130d861347b7:2:153982)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692078
at qr (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692088)
at o (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695159)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695222
at t._init (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:695235)
at new a (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:692574)
at vendor.js?id=1e442c890616af120be86f4594f164b7:2489:685664
at init (vendor.js?id=1e442c890616af120be86f4594f164b7:2489:685695)

@matt-smarsh
Copy link

This is also affecting me. It would seem that initProps is now called before the beforeCreate hook, which is what most libraries, including vue-i18n and vuetify, use to hang their $t and $vuetify properties off of the component vm.
image

@matt-smarsh
Copy link

Thank you for the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants