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.
I can't reproduce it - I've run the same commands on codesandbox.io and it works fine there. However, I tried creating a new Angular app and running the same app on a different machine and both resulted in issues.
On two machines I own, running ng new, adding Vitest as documented and fixing the issues mentioned in the description result in the error in the title.
Which area/package is the issue in?
Don't know / other
Description
I can't reproduce it - I've run the same commands on codesandbox.io and it works fine there. However, I tried creating a new Angular app and running the same app on a different machine and both resulted in issues.
Two issues I encountered running the commands: ng g @analogjs/platform:setup-vitest --project [your-project-name] adds vitest 1.31.1 to package.json which can't be installed because this version doesn't exist. I assumed it was meant to be 1.3.1, after changing and running npm i I get an error about not being able to use ESBuild modules - I might remember wrong, but the solution was to change extension of vite.config from ts to mts. Those errors also happened on codesandbox so they probably don't cause my issue.
It's probably more of a question than a bug since I know the code works on codesandbox, but I have no idea whatsoever what causes it to fail on my machines.
Please provide the exception or error you saw
C:\repos\app\asd [feature-frontend-skeleton ≡ +1 ~2 -0 !]> npm run test --verbose
npm verb cli C:\Program Files\nodejs\node.exe C:\Users\***\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm info using npm@10.5.0
npm info using node@v20.11.1
npm verb title npm run test
npm verb argv "run" "test" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:C:\Users\***\AppData\Local\npm-cache\_logs\2024-03-18T19_11_57_493Z-
npm verb logfile C:\Users\***\AppData\Local\npm-cache\_logs\2024-03-18T19_11_57_493Z-debug-0.log
> asd@0.0.0 test
> ng test
DEV v1.4.0 C:/repos/app/asd
❯ src/app/app.component.spec.ts (1)
❯ AppComponent (1)
× should create the app
\ [ afterEach ]
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/app/app.component.spec.ts > AppComponent > should create the app
NullInjectorError: R3InjectorError[TestComponentRenderer -> TestComponentRenderer]:
NullInjectorError: No provider for TestComponentRenderer!
❯ NullInjector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:1654:27
❯ R3Injector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:3093:33
❯ R3Injector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:3093:33
❯ TestBedImpl.inject ../../packages/core/testing/src/test_bed.ts:548:58
❯ TestBedImpl.createComponent ../../packages/core/testing/src/test_bed.ts:618:40
❯ Function.createComponent ../../packages/core/testing/src/test_bed.ts:366:33
❯ src/app/app.component.spec.ts:11:33
9| });
10|
11| it('should create the app', () => {
| ^
12| const fixture = TestBed.createComponent(AppComponent);
13| const app = fixture.componentInstance;
❯ _ZoneDelegate.invoke node_modules/zone.js/fesm2015/zone.js:368:26
❯ ProxyZoneSpec.onInvoke node_modules/zone.js/fesm2015/zone-testing.js:273:39
❯ _ZoneDelegate.invoke node_modules/zone.js/fesm2015/zone.js:367:52
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { ngTempTokenPath: null, ngTokenPath: [ 'TestComponentRenderer', 'TestComponentRenderer' ] }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
FAIL src/app/app.component.spec.ts > AppComponent > should create the app
NullInjectorError: R3InjectorError[TestComponentRenderer -> TestComponentRenderer]:
NullInjectorError: No provider for TestComponentRenderer!
❯ NullInjector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:1654:27
❯ R3Injector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:3093:33
❯ R3Injector.get ../../app/asd/node_modules/@angular/core/fesm2022/core.mjs:3093:33
❯ TestBedImpl.inject ../../packages/core/testing/src/test_bed.ts:548:58
❯ TestBedImpl.tearDownTestingModule ../../packages/core/testing/src/test_bed.ts:771:31
❯ TestBedImpl.resetTestingModule ../../packages/core/testing/src/test_bed.ts:479:16
❯ ../../packages/core/testing/src/test_hooks.ts:34:15
❯ _ZoneDelegate.invoke node_modules/zone.js/fesm2015/zone.js:368:26
❯ ProxyZoneSpec.onInvoke node_modules/zone.js/fesm2015/zone-testing.js:273:39
❯ _ZoneDelegate.invoke node_modules/zone.js/fesm2015/zone.js:367:52
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { ngTempTokenPath: null, ngTokenPath: [ 'TestComponentRenderer', 'TestComponentRenderer' ] }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
Test Files 1 failed (1)
Tests 1 failed (1)
Start at 20:11:59
Duration 1.48s (transform 215ms, setup 409ms, collect 184ms, tests 90ms, environment 466ms, prepare 638ms)
FAIL Tests failed. Watching for file changes...
press h to show help, press q to quit
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:
If you can share the test repo that would help. I'm able to run the tests after adjusting the version and changing vite.config.ts to vite.config.mts
npx @angular/cli@latest new angular-analog-vitest
cd angular-analog-vitest
npm i @analogjs/platform --save-dev
ng g @analogjs/platform:setup-vitest --project angular-analog-vitest
(Update package.json to ^1.3.1 after npm install error)
npm i
Rename vite.config.ts to vite.config.mts
npm run test
I found the issue and it's a weird one - it fails only when there are spaces in the project's path. I have spaces in the name of my repository, so it failed there, and when I created an app called analog-vitest-error-repro it failed. When I rename the directory to analog vitest error repro it's failing with the same issue my repository does. Here's a repository with a folder with spaces: https://github.com/redzimskidev/analog-vitest-error-repro
I tried recreating the bug with github actions but it seems spaces break that too(or I can't figure it out).
Please provide the environment you discovered this bug in.
I can't reproduce it - I've run the same commands on codesandbox.io and it works fine there. However, I tried creating a new Angular app and running the same app on a different machine and both resulted in issues.
On two machines I own, running ng new, adding Vitest as documented and fixing the issues mentioned in the description result in the error in the title.
Which area/package is the issue in?
Don't know / other
Description
I can't reproduce it - I've run the same commands on codesandbox.io and it works fine there. However, I tried creating a new Angular app and running the same app on a different machine and both resulted in issues.
Two issues I encountered running the commands:
ng g @analogjs/platform:setup-vitest --project [your-project-name]
adds vitest 1.31.1 to package.json which can't be installed because this version doesn't exist. I assumed it was meant to be 1.3.1, after changing and running npm i I get an error about not being able to use ESBuild modules - I might remember wrong, but the solution was to change extension of vite.config from ts to mts. Those errors also happened on codesandbox so they probably don't cause my issue.It's probably more of a question than a bug since I know the code works on codesandbox, but I have no idea whatsoever what causes it to fail on my machines.
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: