TanStack / query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
https://tanstack.com/query
MIT License
40.53k stars 2.73k forks source link

Errors after upgrade to Vite 5 / Rollup 4 #6433

Closed Kamahl19 closed 6 months ago

Kamahl19 commented 6 months ago

Describe the bug

After upgrading to Vite 5 which uses Rollup 4, I am getting 2 errors when building.

node_modules/@tanstack/react-query-devtools/build/modern/index.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
node_modules/@tanstack/react-query/build/modern/useBaseQuery.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/tanstack-query-example-react-simple-cn8h2r?embed=1

Steps to reproduce

  1. upgrade to vite v5
  2. run vite build

Expected behavior

No error should be shown

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

any

Tanstack Query adapter

react-query

TanStack Query version

5.8.6

TypeScript version

5.2.2

Additional context

No response

TkDodo commented 6 months ago

Steps to reproduce upgrade to vite v5 run vite build

why can't you show a sandbox that has vite v5 already? I don't know which breaking config changes there are between v3 and v5 ...

TkDodo commented 6 months ago

I added a quick integration test for vite5, which works fine. So I think your issue must be somewhere else

Kamahl19 commented 6 months ago

Might be related to https://github.com/vitejs/vite/issues/15012

Stanzilla commented 2 months ago

Getting the same now only after adding Sentry to the project and enabling SourceMaps

PymZoR commented 1 month ago

Getting the same now only after adding Sentry to the project and enabling SourceMaps

Same here