I've noticed this bug after merging the following PR: TanStack/query#5597
When bundle: true
is set, index.js
(ESM) file looks like this:
import "./chunk-55J6XMHW.js";
import {
QueriesObserver
} from "./chunk-FVYPMHO2.js";
import {
QueryClient
} from "./chunk-6F4EPMPD.js";
import {
QueryCache
} from "./chunk-5EQKN4WB.js";
import "./chunk-CSKZ3U2N.js";
...
When bundle: false
is set, index.js
(ESM) file looks like this:
import { CancelledError } from "./retryer";
import { QueryCache } from "./queryCache";
import { QueryClient } from "./queryClient";
import { QueryObserver } from "./queryObserver";
import { QueriesObserver } from "./queriesObserver";
import { InfiniteQueryObserver } from "./infiniteQueryObserver";
...
I expected that tsup would also add the required .mjs
(or .js
when "type": "module"
is set) to relative imports within the project, like rollup did. This causes import errors when imported in ESM projects (e.g. Vite). For now, I've added https://github.com/favware/esbuild-plugin-file-path-extensions, but this seems to force override some tsup settings.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too