Skip to content

[v9.10.0] @intlify/message-compiler publishing missing TypeScript reference #1760

@shengslogar

Description

@shengslogar

Reporting a bug?

Beginning in v9.10.0 and persistent in v9.10.1, @intlify/message-compiler/dist/message-compiler.d.ts is publishing the following TS reference:

/// <reference types="node_modules/.pnpm/[email protected]/node_modules/source-map-js/source-map" />

https://www.npmjs.com/package/@intlify/message-compiler/v/9.10.0?activeTab=code

This causes TS to fail out when compilerOptions.skipLibCheck is set to false in your tsconfig.json.

Expected behavior

I scanned a diff of v9.9.1...v9.10.0 and couldn't see any obvious reason why this line was added, but my naive opinion is we shouldn't be assuming .pnpm is being used.

EDIT: I'm seeing now that PNPM is clearly the development tool for this repo. Not sure what the best practice is here for publishing references.

Expected behavior is to not have any TS references to files outside of the installed package and its dependencies.

Workaround for now is setting compilerOptions.skipLibCheck to true.

Reproduction

https://stackblitz.com/edit/vitejs-vite-1dmm1b?file=package.json

npm run build is automatically run, and you will see the following terminal output:

node_modules/@intlify/message-compiler/dist/message-compiler.d.ts:1:23 - error TS2688: Cannot find type definition file for 'node_modules/.pnpm/[email protected]/node_modules/source-map-js/source-map'.

1 /// <reference types="node_modules/.pnpm/[email protected]/node_modules/source-map-js/source-map" />
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@intlify/message-compiler/dist/message-compiler.d.ts:1

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.3 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-vue: ^4.2.3 => 4.6.2 
    vite: ^4.4.9 => 4.5.2 
    vue: ^3.3.4 => 3.4.21 
    vue-i18n: 9.10.0 => 9.10.0
    vue-tsc: ^1.8.8 => 1.8.27

Screenshot

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugBug or Bug fixes❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions