forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: repro for ERR_OUTDATED_OPTIMIZED_DEP
- Loading branch information
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
playground/environment-custom/src/repro-outdated-dep-entry.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { VueQueryPlugin } from '@tanstack/vue-query' | ||
console.log(VueQueryPlugin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { fileURLToPath } from 'node:url' | ||
import { createServer, createServerModuleRunner } from 'vite' | ||
|
||
// node playground/environment-custom/src/repro-outdated-dep.mjs | ||
// Error: There is a new version of the pre-bundle for "/home/hiroshi/code/others/vite/node_modules/.pnpm/@tanstack+vue-query@5.29.0/node_modules/@tanstack/vue-query/build/modern/useQueryClient.js", a page reload is going to ask for it. | ||
// at throwOutdatedRequest (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:3820:17) | ||
// at TransformContext.transform (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:11696:17) | ||
// at async Object.transform (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:13971:30) | ||
// at async loadAndTransform (file:///home/hiroshi/code/others/vite/packages/vite/dist/node/chunks/dep-BeTFqGKC.js:6039:29) { | ||
// code: 'ERR_OUTDATED_OPTIMIZED_DEP', | ||
// plugin: 'vite:import-analysis', | ||
// id: '/home/hiroshi/code/others/vite/node_modules/.pnpm/@tanstack+vue-query@5.29.0/node_modules/@tanstack/vue-query/build/modern/useQueryClient.js', | ||
|
||
const server = await createServer({ | ||
clearScreen: false, | ||
configFile: false, | ||
root: fileURLToPath(new URL('..', import.meta.url)), | ||
environments: { | ||
custom: { | ||
webCompatible: true, | ||
resolve: { | ||
noExternal: true, | ||
}, | ||
dev: { | ||
optimizeDeps: { | ||
// --- adding either one of these to fix --- | ||
// noDiscovery: true, | ||
// include: ['@tanstack/vue-query'], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
try { | ||
// not ok | ||
const runner = createServerModuleRunner(server.environments.custom) | ||
await runner.import('/src/repro-outdated-dep-entry.mjs') | ||
} finally { | ||
await server.close() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.