We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8c05b4 commit c11c3eaCopy full SHA for c11c3ea
packages/vite-node/src/client.ts
@@ -315,10 +315,10 @@ export class ViteNodeRunner {
315
catch {
316
// old Node throws when invalid path
317
}
318
- if (ok) {
319
- (meta as any).resolve
320
- = (specifier: string, parent?: string | URL) =>
321
- import.meta.resolve(specifier, parent ?? href)
+ (meta as any).resolve = (specifier: string, parent?: string | URL) => {
+ if (!ok)
+ throw new Error('[vite-node] "--experimental-import-meta-resolve" is required to enable "import.meta.resolve"')
+ return import.meta.resolve(specifier, parent ?? href)
322
323
324
0 commit comments