You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I used patch-package to patch @nuxt/test-utils@3.12.1 for the project I'm working on.
When starting nuxt test from a fresh install of test-utils I would get the following error:
ERROR Error: Failed to load url /Users/bahulneel/Projects/Hybr/app/packages/vetting/app/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup (resolved id: /Users/bahulneel/Projects/Hybr/app/packages/vetting/app/node_modules/@nuxt/test-utils/dist/shared/runtime/global-setup). Does the file exist?
I couldn't find any reference here, so I tracked down the cause. Here is the diff that solved my problem:
diff --git a/node_modules/@nuxt/test-utils/dist/config.d.mts b/node_modules/@nuxt/test-utils/dist/config.d.mts
index 385ec4b..5200673 100644
--- a/node_modules/@nuxt/test-utils/dist/config.d.mts+++ b/node_modules/@nuxt/test-utils/dist/config.d.mts@@ -1,4 +1,3 @@-import * as vite from 'vite';
import { InlineConfig } from 'vite';
import { NuxtConfig, Nuxt } from '@nuxt/schema';
import { InlineConfig as InlineConfig$1 } from 'vitest';
diff --git a/node_modules/@nuxt/test-utils/dist/shared/test-utils.B57u8E0c.mjs b/node_modules/@nuxt/test-utils/dist/shared/test-utils.B57u8E0c.mjs
index 1a511b7..57b51cc 100644
--- a/node_modules/@nuxt/test-utils/dist/shared/test-utils.B57u8E0c.mjs+++ b/node_modules/@nuxt/test-utils/dist/shared/test-utils.B57u8E0c.mjs@@ -197,6 +197,6 @@ async function setup(options = {}) {
await setupFn(hooks);
}
-const distDir = dirname(fileURLToPath(import.meta.url));+const distDir = dirname(fileURLToPath(import.meta.url + '/../'));
export { createPage as a, buildFixture as b, createBrowser as c, distDir as d, createTest as e, setup as f, getBrowser as g, loadFixture as l, setupMaps as s, waitForHydration as w };
Hi! 馃憢
Firstly, thanks for your work on this project! 馃檪
Today I used patch-package to patch
@nuxt/test-utils@3.12.1
for the project I'm working on.When starting
nuxt test
from a fresh install oftest-utils
I would get the following error:I couldn't find any reference here, so I tracked down the cause. Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: