Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime dir miss-calculated #818

Open
bahulneel opened this issue Apr 17, 2024 · 0 comments
Open

Runtime dir miss-calculated #818

bahulneel opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bahulneel
Copy link

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 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 };

This issue body was partially generated by patch-package.

@danielroe danielroe added the bug Something isn't working label Apr 22, 2024 — with Volta.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants