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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] vite optimize error #78

Closed
2 tasks
Yberion opened this issue Sep 3, 2022 · 1 comment
Closed
2 tasks

[BUG] vite optimize error #78

Yberion opened this issue Sep 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Yberion
Copy link
Contributor

Yberion commented Sep 3, 2022

Please provide the environment you discovered this bug in.

You just need to create a new analog project on stackblitz and you will face the problem (use the link from de readme)

Here is a repro:

https://stackblitz.com/edit/github-cjjxe9

Which area/package is the issue in?

create-analog

Description

Since #76, there is an error on the postinstall script vite optimize.

If I revert the PR I will face back the problem (#75) that should've been fixed by the PR.

Please provide the exception or error you saw

PS D:\GitHub\analog\analog-project> npm i

> analog-project@0.0.0 postinstall
> vite optimize

X [ERROR] [plugin angular-compiler] TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

    src/app/app.component.spec.ts:5:0:
      5 │ describe('AppComponent', () => {
        ╵ ~~~~~~~~

X [ERROR] [plugin angular-compiler] TS2304: Cannot find name 'beforeEach'.

    src/app/app.component.spec.ts:6:2:
      6 │   beforeEach(async () => {
        ╵   ~~~~~~~~~~

X [ERROR] [plugin angular-compiler] TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

    src/app/app.component.spec.ts:15:2:
      15 │   it('should create the app', () => {
         ╵   ~~

X [ERROR] [plugin angular-compiler] TS2304: Cannot find name 'expect'.

    src/app/app.component.spec.ts:18:4:
      18 │     expect(app).toBeTruthy();
         ╵     ~~~~~~

X [ERROR] [plugin angular-compiler] TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

    src/app/app.component.spec.ts:21:2:
      21 │   it(`should have an initial count of 0`, () => {
         ╵   ~~

X [ERROR] [plugin angular-compiler] TS2304: Cannot find name 'expect'.

    src/app/app.component.spec.ts:24:4:
      24 │     expect(app.count).toEqual(0);
         ╵     ~~~~~~

X [ERROR] [plugin angular-compiler] TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.

    src/app/app.component.spec.ts:27:2:
      27 │   it('should render title', () => {
         ╵   ~~

X [ERROR] [plugin angular-compiler] TS2304: Cannot find name 'expect'.

src/app/app.component.spec.ts:18:4: ERROR: [plugin: angular-compiler] TS2304: Cannot find name 'expect'.
src/app/app.component.spec.ts:21:2: ERROR: [plugin: angular-compiler] TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig.
...
    at failureErrorWithLog (D:\GitHub\analog\analog-project\node_modules\vite\node_modules\esbuild\lib\main.js:1624:15)
    at D:\GitHub\analog\analog-project\node_modules\vite\node_modules\esbuild\lib\main.js:1266:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)npm ERR! code 1
npm ERR! path D:\GitHub\analog\analog-project
npm ERR! command failednpm ERR! command C:\Windows\system32\cmd.exe /d /s /c vite optimize

npm ERR! A complete log of this run can be found in:npm ERR!     C:\Users\Yberion\AppData\Local\npm-cache\_logs\2022-09-03T20_50_41_221Z-debug-0.log
PS D:\GitHub\analog\analog-project>

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@Yberion Yberion added the bug Something isn't working label Sep 3, 2022
@Yberion
Copy link
Contributor Author

Yberion commented Sep 3, 2022

Problem fixed with 78feab2, thank you @brandonroberts :)

@Yberion Yberion closed this as completed Sep 3, 2022
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

1 participant