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
Please provide the environment you discovered this bug in.
@analogjs/vite-plugin-angular : 1.9.4
Which area/package is the issue in?
vite-plugin-angular
Description
I am using the vite-plugin-angular to get my unit tests to work. I have been getting errors such as "Expected to be running in 'ProxyZone', but it was not found." and decided to investigate the plugin to overcome these. Now the ProxyZone errors are gone but now there is an issue with "@angular/build/private".
Please provide the exception or error you saw
Cannot find module '@angular/build/private'
Require stack:
- C:\Users\joe.williams\Projects\Megatron\frontend\src\node_modules\@analogjs\vite-plugin-angular\src\lib\utils\devkit.js
Error: Cannot find module '@angular/build/private'
Require stack:
- C:\Users\joe.williams\Projects\Megatron\frontend\src\node_modules\@analogjs\vite-plugin-angular\src\lib\utils\devkit.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._resolveFilename (C:\Users\joe.williams\Projects\Megatron\frontend\src\node_modules\tsconfig-paths\lib\register.js:103:40)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at file:///C:/Users/joe.williams/Projects/Megatron/frontend/src/node_modules/@analogjs/vite-plugin-angular/src/lib/utils/devkit.js:37:87
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async loadConfigFromBundledFile (file:///C:/Users/joe.williams/Projects/Megatron/frontend/src/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66691:15)
at async loadConfigFromFile (file:///C:/Users/joe.williams/Projects/Megatron/frontend/src/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66532:24)
Other information
No response
I would be willing to submit a PR to fix this issue
Yes
No
The text was updated successfully, but these errors were encountered:
You likely have direct imports from vitest like this: import { describe, it } from 'vitest';
angular tests require patched test hooks (it, describe etc) and when importing them from vitest you get the raw, unpatched ones. You must only use the global, patched functions provided by analog
Hi @AlexAegis thanks for your response. I have only just installed vitest in our project (we were previously using Jest) so there are no imports from vitest that could be causing this. This error seems to be more to do with accessing a directory that doesn't exist...
@joewIST what package manager are you using? The @analogjs/vite-plugin-angular package has peer dependencies, including @angular/build that should be handled by most package managers, with yarn being an exception.
Thanks @brandonroberts. That would explain it; we use Yarn. Is there a workaround for use with Yarn or is this just not supported yet? I couldn't see anything on the documentation but I may have missed something!
Please provide the environment you discovered this bug in.
@analogjs/vite-plugin-angular : 1.9.4
Which area/package is the issue in?
vite-plugin-angular
Description
I am using the vite-plugin-angular to get my unit tests to work. I have been getting errors such as "Expected to be running in 'ProxyZone', but it was not found." and decided to investigate the plugin to overcome these. Now the ProxyZone errors are gone but now there is an issue with "@angular/build/private".
Please provide the exception or error you saw
Other information
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: