egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
9.24k stars 218 forks source link

The es5 plugin run with error #501

Closed ChelesteWang closed 2 years ago

ChelesteWang commented 2 years ago

issue: The es5 plugin run with error

Error: SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.

detail

with initial debugging , I found the "file" property in optional is undefined, in applySourceMap method , it need 2 argument .

Optional. The filename of the source file. If omitted, SourceMapConsumer's file property will be used.

@param sourceFile
Optional. The filename of the source file. If omitted, SourceMapConsumer's file property will be used.

The plugin use @swc/core to translate , The SOURcemap generated by SWC does not contain the file property

Error: SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.
    at SourceMapGenerator.applySourceMap (H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\source-map@0.7.3\node_modules\source-map\lib\source-map-generator.js:181:15)
    at H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:1854:25
    at async Promise.all (index 0)
    at async PluginContainer.buildFinished (H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:1843:5)
    at async runEsbuild (H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:1722:5)
    at async H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:2082:13
    at async Promise.all (index 0)
    at async buildAll (H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:2072:9)
    at async H:\ds\esbuild-web-app-scaffold\node_modules\.pnpm\tsup@5.11.6_ts-node@10.4.0\node_modules\tsup\dist\index.js:2128:7
    at async Promise.all (index 0)
 ELIFECYCLE  Command failed with exit code 1.
ChelesteWang commented 2 years ago

I'm trying to fix it

egoist commented 2 years ago

Fixed in v5.11.7