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

Build error when having multiple attritbutes with colon in name in defineProps #9258

Closed
danielbender1989 opened this issue Sep 20, 2023 · 1 comment

Comments

@danielbender1989
Copy link

Vue version

3.3.4

Link to minimal reproduction

https://stackblitz.com/edit/quasarframework-webpack-lgobhe?file=src%2Fcomponents%2FDTable.vue

Steps to reproduce

  1. Go to reproduction Link
  2. Error comes during build

What is expected?

When using an interface with multiple colons as attributes, it compiles without problems and can be used in the component.

Example:

<template>
  <div>Hello</div>
</template>

<script setup lang="ts">
defineProps<{
  'onUpdate:Y'?: (y: number) => void;
  'onUpdate:X'?: (x: number) => void;
}>();
</script>

What is actually happening?

During build an error is thrown. If there is only one prop with a colon in the attribute it doesn't throw.

Error in error handler:
Error: offset is longer than source length! offset 206 > length 184
at numberToPos (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:18524:15)
at formatError (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39102:35)
at error (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39076:19)
at transform (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39320:25)

Unexpected token, expected "," (7:14)
Error in error handler:
Error: offset is longer than source length! offset 206 > length 184
at numberToPos (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:18524:15)
at formatError (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39102:35)
at error (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39076:19)
at transform (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39320:25)

11:55:03 [vite] Internal server error: Unexpected token, expected "," (7:14)
Plugin: vite:vue
File: /home/projects/quasarframework-webpack-lgobhe/src/components/DTable.vue

Error in error handler:
Error: offset is longer than source length! offset 206 > length 184
at numberToPos (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:18524:15)
at formatError (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39102:35)
at error (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39076:19)
at transform (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39320:25)

11:55:09 [vite] Internal server error: Unexpected token, expected "," (7:14)
Plugin: vite:vue
File: /home/projects/quasarframework-webpack-lgobhe/src/components/DTable.vue

Error in error handler:
Error: offset is longer than source length! offset 206 > length 184
at numberToPos (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:18524:15)
at formatError (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39102:35)
at error (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39076:19)
at transform (/home/projects/quasarframework-webpack-lgobhe/node_modules/vite/dist/node/chunks/dep-6e2fe41e.js:39320:25)

11:55:49 [vite] Internal server error: Unexpected token, expected "," (7:14)
Plugin: vite:vue
File: /home/projects/quasarframework-webpack-lgobhe/src/components/DTable.vue

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz   
    Memory: 12.65 GB / 31.88 GB
  Binaries:
    Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
    npm: 9.3.1 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (117.0.2045.31)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.3.4 => 3.3.4

Any additional comments?

No response

@danielbender1989
Copy link
Author

Duplicate of #8910

@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant