Destructured default value failed on named slots

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

Version

2.7.13

Reproduction link

github.com

Steps to reproduce

  1. run npm i
  2. run npm run dev
  3. open dev url in browser

What is expected?

no error

What is actually happening?

After open dev url in browser given following error.

Invalid shorthand property initializer. (1:7)
[vite] Internal server error: Invalid shorthand property initializer. (1:7)
  Plugin: vite:vue2
  File: C:/Users/user/Desktop/v-slot-issue/src/App.vue
  1  |  <script setup lang="ts">
     |         ^
  2  |  import Test from './Test.vue'
  3  |  </script>
      at instantiate (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:72:32)
      at constructor (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:359:12)
      at Object.raise (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:3339:19)
      at Object.checkExpressionErrors (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:4083:12)
      at Object.parseMaybeAssign (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:12359:12)
      at Object.parseMaybeAssign (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:10730:20)
      at Object.parseExpressionBase (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:12257:23)
      at C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:12251:39
      at Object.allowInAnd (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:14346:16)
      at Object.parseExpression (C:\Users\user\Desktop\v-slot-issue\node_modules\@babel\parser\lib\index.js:12251:17)

It looks like a similar issue as #12591 but on v-slot.

The issue seems to be solved by export slotRE and use it to set slot baseName in compileScript.ts.

          const baseName = onRE.test(name)
            ? 'on'
+           : slotRE.test(name)
+           ? 'slot'
            : bindRE.test(name)
            ? 'bind'
            : name.replace(dirRE, '')
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
How to run your great works 1 2021-01-17 2022-09-16
Shorts' Duration Not Showing in Videos Tab 1 2022-11-01 2022-11-03
ODBC的set_attribute方法调用SQLSetConnectAttr的参数传递错误 1 2020-08-31 2022-07-02
it would be possible linux version of dbi? 3 2021-11-01 2022-11-20
potential DBIBackend python script improvement 4 2021-11-20 2022-11-20
There are two RepeatMode enums 0 2022-03-27 2022-10-08
C shared library - proper versioned SONAME and ABI stability 5 2022-04-01 2022-11-28
Export to excel errors 10 2022-03-22 2022-12-09
when changing \begin{math}-->\begin{equation}: no differences are displayed in pdf 1 2021-10-15 2022-12-06
[Feature]: Add option to delete task in the context menu 0 2022-02-02 2022-09-29
Strange BGR effect after conversion 0 2021-02-12 2022-10-25
Supporting PDF builds 8 2016-12-12 2022-10-08
Restricting attention weights to domain 0 2020-04-30 2022-11-02
[Issue] Model becomes invisible upon glTF export, no export occurs 11 2021-10-18 2022-12-03
TypeError: getProcessedPlugins is not a function 0 2021-06-25 2022-11-14
vram leak when using bar 2 2021-06-26 2022-09-18
Prevent double configuration for the same plugin 1 2017-02-12 2022-11-25
Add returnofreckoning.com 0 2020-11-04 2022-11-15
dedicated github page website that looks similar to twofactorauth.org 22 2019-01-21 2022-11-15
SBOM import- PURL's are not entered 2 2022-11-17 2022-12-07
Don't cache /_status endpoints (all apps) 1 2021-03-26 2022-10-20
Failed to create Chrome process 2 2021-05-13 2022-12-02
Wrong syntax makes cowrie crash 1 2022-08-23 2022-12-03
_select_utxos() function not factoring in the minimum output UTXO amount 3 2021-11-30 2022-11-22
Jakarta Servlet Support 9 2021-10-31 2022-10-03
java.lang.NullPointerException 1 2018-05-10 2022-11-21
how to convert msg to pcd form rosbag that the topic is "/sensor/lidar/velodyne_multi_scans" and type is sensor_interface/VelodyneScan 0 2021-04-21 2022-11-28
Intermittent UI test failure - WebControlsTest.verifyDropdownMenuTest 1 2022-05-27 2022-11-19
GSoc : Introdution/A query : Mohammad Samad 0 2020-03-27 2022-11-12
proyecto 1ensayo 1 2021-09-08 2021-12-24
Photon exception in extreme network conditions 2 2021-05-13 2022-11-22
Reduce Tile height in Tiles layout 2 2022-01-19 2022-11-24
Two clients publish asynchronously, and message loss occurs 2 2021-10-02 2022-11-28
Manifest version validation error 2 2021-04-27 2022-11-27
PCGUARD instrumentation may generate crashing binary 9 2021-10-18 2022-11-19
Syntax support for SQL ANALYTIC WINDOW functions 1 2021-03-09 2022-12-07
How can i mosaic 50% of my dataset and don not mosaic other 50% of dataset? 3 2022-06-15 2022-09-18
Azure Subscriptions - Check Zone Peers isn't work 0 2022-08-22 2022-08-19
[Azure Cosmos DB account]Request to remove the deprecated `Parse` of `kind` in `DatabaseAccounts_CreateOrUpdate` API 1 2022-08-17 2022-08-22
Optionals that are somewhat positional 4 2022-03-02 2022-11-19
integer flags not working with optional 1 2022-05-20 2022-11-28
[Docs] Provide example dockerfile and docker-compose for openmct 0 2022-01-24 2022-12-01
[工程模块] 支持DSS删除工程同步Visualis删除工程 0 2022-06-17 2022-11-19
Edition #106 Submissions (Part 2) 5 2021-09-13 2021-10-05
Edition #107 Submissions 10 2021-09-28 2021-10-05
Vue3 quasar 0 2021-07-15 2021-11-24
Can't delete any images 17 2022-05-12 2022-11-02
Low-level foreign key APIs ignore inherited foreign keys, creating some edge cases 0 2021-10-06 2022-11-12
Add support for signing transactions with Trezor accounts 1 2021-10-27 2022-12-03
Col classes "m" and up adds a huge left margin 1 2021-07-31 2022-12-09