Skip to content

https://github.com/parcel-bundler/parcel/commit/05604990d7531e5bd348abbc435b3dc5d49ad7fd breaks Typescript compilation #9589

@blipper

Description

@blipper

🐛 bug report

import type {AbortSignal} from 'abortcontroller-polyfill/dist/cjs-ponyfill';

causes an export to types.d.ts which breaks compilation in Typescript

🤔 Expected Behavior

Should compile cleanly but if tsconfig is configured not to import jsmodules this will fail since this doesn't have types
https://www.perplexity.ai/search/abortcontroller-types-40irSIhoTL6xReYpjSOO7g#0
mo/abortcontroller-polyfill#44

😯 Current Behavior

../../../node_modules/@parcel/cache/lib/types.d.ts:2:34 - error TS7016: Could not find a declaration file for module 'abortcontroller-polyfill/dist/cjs-ponyfill'. '/workplace/mnr/SafeFrameClient/src/D16GSafeFrame/node_modules/abortcontroller-polyfill/dist/cjs-ponyfill.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/abortcontroller-polyfill` if it exists or add a new declaration (.d.ts) file containing `declare module 'abortcontroller-polyfill/dist/cjs-ponyfill';`

2 import type { AbortSignal } from "abortcontroller-polyfill/dist/cjs-ponyfill";

💁 Possible Solution

Declare a local type.

🔦 Context

Fails to build

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.12.
Node
npm/Yarn
Operating System

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions