Issue on the props definition after update from 2.7.10 to 2.7.11

This issue has been created since 2022-10-11.

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 wrote this answer on 2022-10-15

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 wrote this answer on 2022-10-15

Thank you for the quick turnaround!

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-12-10
Star Count 201155
Watcher Count 6070
Fork Count 33134
Issue Count 595

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
[BUG] Language selecter doesn't work when pasting code 5 2022-10-29 2022-12-04
Cannot find end-of-document symbol (</s>) in tokenizer 5 2022-05-31 2022-10-03
[Feature Request] Search Plex before sending the request to Radarr/Sonarr 11 2020-08-22 2022-07-11
Cannot install the kernel headers properly 16 2021-09-30 2022-11-11
Installing on pfsense 2.6 failed - fixed 4 2022-08-22 2022-09-07
Social Icons bug needs to be resolved 2 2021-06-21 2022-08-28
Editor: make Global Variables pane list to have a tree folder structure 0 2022-06-26 2022-10-07
Vocabulary keyword meta-data, particularly for in-place applicators 11 2018-06-06 2022-11-25
Real aggregation of KShards 1 2021-09-08 2022-11-18
Get the Map (and current location?) from the Robot-sweeper? 1 2022-08-15 2022-10-07
Unable to pair PSMove controller to M1 Macbook Air (Ventura) 3 2022-12-03 2022-12-09
Python 3.9.0 - 'Thread' object has no attribute 'isAlive' 2 2020-11-25 2022-11-23
simplified gpg.conf default preferences 1 2020-12-18 2022-11-25
Adding language model error rate increases rapidly 4 2022-01-03 2022-10-05
Proxy Request Refused with --hostname and portal.mozz.us 2 2021-03-02 2022-11-26
Supports Clang-Tidy v11 messages with multiple check (alias) ids 0 2021-05-26 2022-11-30
Latest maps API 0 2021-09-19 2022-01-08
Redefine alert errors 1 2021-04-28 2022-03-03
Windows window manipulation is ignored while in relative mouse mode 0 2021-10-06 2022-11-16
能不能把redis的geo功能也实现一下 2 2020-12-25 2022-11-02
Configure SSL wildcard certificates autorenewal 0 2021-12-10 2022-10-06
Add serializer for SqlNode 0 2021-08-06 2022-11-11
Add Delete button to Dashboard editor 0 2021-07-28 2022-11-14
Activate Card menu actions 1 2021-07-28 2022-10-11
Writing to a characteristic throws permission error with UARTservice and "not supported" error with custom service. RPi Zero W. 12 2021-08-15 2022-10-16
Offline / Caching Support? 2 2021-05-25 2022-11-24
Incorrect indentation mismatch 0 2022-06-22 2022-12-05
[Feature Request] New environnement variable: DEFAULT LANGUAGE 3 2022-05-20 2022-12-06
Does dgiot have a device management system? 0 2022-03-31 2022-07-22
What database is dgiot using 0 2022-04-07 2022-11-05
Server-wide media retention policy 14 2020-02-03 2022-11-03
function.length is lost 4 2021-04-07 2022-12-05
Enable wallpaper onboarding flag 2 2022-09-20 2022-11-15
'cap.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 89. 1 2021-09-14 2022-11-19
BUG: CI cannot create benchmark environments with Cython < 0.29.24 1 2021-10-17 2022-11-03
League\Flysystem\CorruptedPathDetected 2 2022-02-23 2022-12-07
[BUG] AnimateSharedLayout offsets on first render 1 2021-05-26 2022-11-03
[Bug]: Electron app cannot open any web page when sandboxed 2 2022-03-30 2022-11-07
No library called "libcairo-2" was found 5 2022-11-19 2022-11-20
Option to filter out imperative benchmarks 3 2022-10-18 2022-11-27
Recursive by default not effective since 89.0 1 2021-10-01 2022-11-15
Button rendering problem 2 2021-02-20 2022-11-25
Standardize status check of code coverage for pull requests 4 2021-08-27 2022-12-06
建议指定编码方式 encoding='utf-8' 5 2017-10-12 2022-11-20
Allow treating sub-folders matching a pattern as projects 3 2017-10-31 2022-10-28
Time of connection to the course and contents displayed 0 2022-08-12 2022-08-29
Add support for e2e binding 3 2016-01-29 2022-12-08
Add Monaca template for vue and webpack 1 2020-08-18 2022-10-04
Not Able to Generate NUnit Tests 4 2016-04-26 2022-11-24
How to get and display all markers of current viewport while map drag or zoom. 4 2020-05-21 2022-11-26