Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Upgrade esbuild for const type parameters?Β #48

@karlhorky

Description

@karlhorky

Hey @lukeed πŸ‘‹ hope you're well!

It seems that [email protected] added support for TS 5.0 const type parameters

Currently, [email protected] depends on esbuild@^0.15.16, and runs into errors like Expected identifier but found "const":

✘ [ERROR] Expected identifier but found "const"

    /Users/k/p/project/index.ts:29:40:
      29 β”‚ export async function getProjectFixture<const Fixture extends { id: number }>(
         β•΅                                         ~~~~~

/Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:1575
  let error = new Error(`${text}${summary}`);
              ^

Error: Transform failed with 1 error:
/Users/k/p/project/index.ts:29:40: ERROR: Expected identifier but found "const"
    at failureErrorWithLog (/Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:1575:15)
    at /Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:814:29
    at responseCallbacks.<computed> (/Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:680:9)
    at handleIncomingPacket (/Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:735:9)
    at Socket.readFromStdout (/Users/k/p/project/node_modules/tsm/node_modules/esbuild/lib/main.js:656:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

Proposed Solution

What do you think about upgrading to esbuild@^0.18.6?

Seems like forcing the upgrade to the transitive esbuild dependency via Yarn Resolutions works in our project and enables the const type parameters πŸ‘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions