Comments (5)
This bisects to #58326. @iisaduan
Your repro doesn't need yarn build
, just tsc
, however needs skipLibCheck: true
and types: []
.
from typescript.
We need a shorter repro here if we're going to investigate something that's observably more-correct
from typescript.
OK, I've managed to set something up at https://github.com/Glandos/test-ts-55/
There are maybe too much dependencies, but it's a strip down version of my project. With dependencies in yarn cache with LFS.
Maybe there's also too much .d.ts. Tell me if it's minimal enough :)
from typescript.
20-30 lines in three files (plus config) or less is the target here; that's all that should be needed to demonstrate the described problem if it's actually a bug
from typescript.
OK, I think my reproduction repository at https://github.com/Glandos/test-ts-55 is now stripped down.
I removed every unneeded dependency, like eslint or babel. There still is 2 .d.ts
, to mimic vue-cli
default layout, but they are quite small.
So, valid test case is:
test-ts-55 on main via v16.20.2 ❯ yarn add -D [email protected]; yarn build
➤ YN0000: ┌ Resolution step
➤ YN0002: │ test-ts-55@workspace:. doesn't provide @types/node (p3effd), requested by ts-node
➤ YN0060: │ test-ts-55@workspace:. provides vue (peb3bf) with version 2.7.16, which doesn't satisfy what @intlify/vue-i18n-loader requests
➤ YN0060: │ test-ts-55@workspace:. provides vue-i18n (p5b9ff) with version 8.28.2, which doesn't satisfy what @intlify/vue-i18n-loader and some of its descendants request
➤ YN0002: │ vue-i18n-bridge@npm:9.14.0 [2d053] doesn't provide vue (pc32ff), requested by vue-demi
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 270ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 453ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 267ms
➤ YN0000: Done with warnings in 1s 111ms
All browser targets in the browserslist configuration have supported ES module.
Therefore we don't build two separate bundles for differential loading.
⠴ Building for production...
DONE Compiled successfully in 2046ms 11:41:53
File Size Gzipped
dist/js/chunk-vendors.5bb89914.js 153.42 KiB 50.37 KiB
dist/js/app.20744630.js 1.67 KiB 0.90 KiB
Images and other types of assets omitted.
Build at: 2024-09-24T09:41:53.869Z - Hash: 28da518052812f49 - Time: 2046ms
DONE Build complete. The dist directory is ready to be deployed.
INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
And invalid one:
test-ts-55 on main via v16.20.2 ⏰6s345ms❯ yarn add -D [email protected]; yarn build
➤ YN0000: ┌ Resolution step
➤ YN0002: │ test-ts-55@workspace:. doesn't provide @types/node (p3effd), requested by ts-node
➤ YN0060: │ test-ts-55@workspace:. provides vue (peb3bf) with version 2.7.16, which doesn't satisfy what @intlify/vue-i18n-loader requests
➤ YN0060: │ test-ts-55@workspace:. provides vue-i18n (p5b9ff) with version 8.28.2, which doesn't satisfy what @intlify/vue-i18n-loader and some of its descendants request
➤ YN0002: │ vue-i18n-bridge@npm:9.14.0 [2d053] doesn't provide vue (pc32ff), requested by vue-demi
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 755ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ typescript@npm:5.5.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ typescript@patch:typescript@npm%3A5.5.2#~builtin<compat/typescript>::version=5.5.2&hash=379a07 can't be found in the cache and will be fetched from the disk
➤ YN0019: │ typescript-npm-5.4.5-8568a42232-53c879c6fa.zip appears to be unused - removing
➤ YN0019: │ typescript-patch-cef5f9d32b-d59e26e74f.zip appears to be unused - removing
➤ YN0000: └ Completed in 0s 410ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 480ms
➤ YN0000: Done with warnings in 1s 802ms
All browser targets in the browserslist configuration have supported ES module.
Therefore we don't build two separate bundles for differential loading.
⠼ Building for production...
ERROR Failed to compile with 2 errors 11:42:12
error in src/main.ts:6:9
TS2769: No overload matches this call.
Overload 1 of 2, '(plugin: PluginObject<unknown> | PluginFunction<unknown>, options?: unknown): VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>>>', gave the following error.
Argument of type 'typeof VueI18n' is not assignable to parameter of type 'PluginObject<unknown> | PluginFunction<unknown>'.
Property 'install' is missing in type 'typeof VueI18n' but required in type 'PluginObject<unknown>'.
Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<...>>>', gave the following error.
Argument of type 'typeof VueI18n' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
Property 'install' is missing in type 'typeof VueI18n' but required in type 'PluginObject<any>'.
4 |
5 | // Bridge is done in vue.config.js
> 6 | Vue.use(VueI18n)
| ^^^^^^^
7 |
8 | const i18n = createI18n({
9 | legacy: false,
error in src/main.ts:24:13
TS2322: Type 'TranslateResult' is not assignable to type 'string'.
Type 'LocaleMessages' is not assignable to type 'string'.
22 | computed: {
23 | title() {
> 24 | const title: string = this.$t('hello')
| ^^^^^
25 | return title
26 | }
27 | }
ERROR Error: Build failed with errors.
Error: Build failed with errors.
at /home/adrien/Documents/netbeans/test-ts-55/node_modules/@vue/cli-service/lib/commands/build/index.js:207:23
at /home/adrien/Documents/netbeans/test-ts-55/node_modules/webpack/lib/webpack.js:168:8
at /home/adrien/Documents/netbeans/test-ts-55/node_modules/webpack/lib/HookWebpackError.js:67:2
at _done (eval at create (/home/adrien/Documents/netbeans/test-ts-55/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at eval (eval at create (/home/adrien/Documents/netbeans/test-ts-55/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:34:22)
from typescript.
Related Issues (20)
- Array of unions changed to union of arrays in conditional type HOT 4
- tsserver requires `npm` to be installed on `neovim` trough `mason` HOT 2
- RangeError: Maximum call stack size exceeded when calling `getJsDocTags` on getter of class that implements itself
- Class constructors that early return another object still require fields to be assigned HOT 2
- [NewErrors] 5.7.0-dev.20240922 vs 5.6.2 HOT 6
- [ServerErrors][JavaScript] 5.7.0-dev.20240922 vs 5.6.2 HOT 3
- [ServerErrors][TypeScript] 5.7.0-dev.20240922 vs 5.6.2 HOT 7
- IsolatedDeclarations: emitted declarations inconsistent between `transpileDeclaration` API and TypeScript Playground HOT 1
- Inconsistent typechecking with require() in JS and TS HOT 5
- TypeScript fails to narrow union of native Error types HOT 5
- Typed JSON imports HOT 3
- Proposal: Expand `inferFromTypeArguments()` candidates to include heritage elements HOT 1
- `ReadonlySet` and `ReadonlyMap` are lacking `Symbol.toStringTag`
- Wrong type is generated by typescript HOT 6
- wrong type ordering generated by `tsc`? HOT 9
- Typing error when adding an element to a generic Map not catched by Typescript HOT 6
- Type of outer variable inside functions is not affected by narrowing in outer scope HOT 1
- Function expression or method is not inferable when we have mapped type with a conditional type HOT 2
- Predicates break arbitrarily when intersected with some types. (Probably when the predicate is generic).
- Specialized error message when too new a lib is provided
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript.