Giter VIP home page Giter VIP logo

Comments (5)

jakebailey avatar jakebailey commented on September 27, 2024 1

This bisects to #58326. @iisaduan

Your repro doesn't need yarn build, just tsc, however needs skipLibCheck: true and types: [].

from typescript.

RyanCavanaugh avatar RyanCavanaugh commented on September 27, 2024

We need a shorter repro here if we're going to investigate something that's observably more-correct

from typescript.

Glandos avatar Glandos commented on September 27, 2024

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.

RyanCavanaugh avatar RyanCavanaugh commented on September 27, 2024

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.

Glandos avatar Glandos commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.