Skip to content

Commit

Permalink
Fix @tanstack/query-devtools on legacy browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrylyzo committed Aug 30, 2024
1 parent e0641ee commit e0dd76f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/RootApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const RootApp = () => (
</WebConfigProvider>
</UserSettingsProvider>
</ApiProvider>
<ReactQueryDevtools initialIsOpen={false} />
{window.Proxy && ( // '@tanstack/query-devtools' requires 'Proxy', which cannot be polyfilled for legacy browsers
<ReactQueryDevtools initialIsOpen={false} />
)}
</QueryClientProvider>
);

Expand Down
17 changes: 17 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ const config = {
}
}]
},
// Strict EcmaScript modules require additional flags
{
test: /\.(js|jsx|mjs)$/,
include: [
path.resolve(__dirname, 'node_modules/@tanstack/query-devtools')
],
resolve: {
fullySpecified: false
},
use: [{
loader: 'babel-loader',
options: {
cacheCompression: false,
cacheDirectory: true
}
}]
},
{
test: /\.worker\.ts$/,
exclude: /node_modules/,
Expand Down

0 comments on commit e0dd76f

Please sign in to comment.