Esbuild-loader complains about /../../tsconfig.shared' not found

Hi all,

after recent upgrade to latest we get this error from esbuild when starting a webpack server. Our rules are these:

	{
		loader: 'esbuild-loader',
		test: /\.js$/,
		options: {
			target: 'es2022', // https://esbuild.github.io/content-types/#javascript
		},
		exclude: [
			/(ext-)/,
			/node_modules[\\/]core-js/,
			/node_modules[\\/]webpack/
		],
	},

And our only imports are these:

import Uppy from '@uppy/core';
import XHRUpload from '@uppy/xhr-upload';
import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles';

We get rid of the error only if we exclude uppy frrom esbuild compile. Also looked in node_modules and utils package has tsconfig looking for the shared one, but there’s no file indeed in uppy root directory.

Any idea why this happens and how to fix properly ?

Vadim

Hi, can you try to remove the tsconfig.json manually and confirm whether that fixes the issue? AFAIK build tools should not need the tsconfig.json, they should use the already build files, so maybe there’s a simple fix on Uppy side to exclude tsconfig.json from its npm bundle.

Removing them manually of course works…

Anyone from Uppy team ? Or i should report a bug on github ?!

Bug reports are certainly welcome on GitHub, and should give you a better experience as you would be notified when a fix was merged. FYI you can use yarn patch or patch-package to unblock you when you face an issue that requires an easy upstream fix such as this one.
FWIW the latest Uppy releases do not include a tsconfig.json file, which should fix the error you were seeing.