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

declaration of 'server.force' error #8398

Closed
7 tasks done
asasugar opened this issue May 30, 2022 · 5 comments
Closed
7 tasks done

declaration of 'server.force' error #8398

asasugar opened this issue May 30, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@asasugar
Copy link

Describe the bug

Type '{ port: number; fs: { strict: true; }; hmr: true; force: true; }' cannot be assigned to type 'ServerOptions'.
Object literals can specify only known properties, and 'force' is not in type 'ServerOptions'. ts(2322)
index.d.ts(2171, 5): The required type is from the property "server", which is declared on the "UserConfig" type here

I found that the declaration of 'server.force' is under UserConfig, according to the documentation of vite, the declaration of force should be under ServerOptions

Reproduction

https://github.com/asasugar/vite-element-plus-admin

System Info

System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 373.59 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 15.1.0 - ~/.nvm/versions/node/v15.1.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Browsers:
    Chrome: 97.0.4692.99
    Safari: 15.5
  npmPackages:
    @vitejs/plugin-legacy: ^1.8.1 => 1.8.1 
    @vitejs/plugin-vue: ^2.0.0 => 2.3.1 
    @vitejs/plugin-vue-jsx: ^1.3.10 => 1.3.10 
    vite: 3.0.0-alpha.7 => 3.0.0-alpha.7

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red sapphi-red added documentation Improvements or additions to documentation and removed pending triage labels May 30, 2022
@sapphi-red
Copy link
Member

You are using 3.0.0-alpha.7 which includes a breaking change (#8280). The currently deployed docs are for v2.
https://github.com/asasugar/vite-element-plus-admin/blob/af8d61750db480bca88dc784e218e027a1843db4/package.json#L67

Please use config.force instead of config.server.force.

@asasugar
Copy link
Author

You are using 3.0.0-alpha.7 which includes a breaking change (#8280). The currently deployed docs are for v2. https://github.com/asasugar/vite-element-plus-admin/blob/af8d61750db480bca88dc784e218e027a1843db4/package.json#L67

Please use config.force instead of config.server.force.

ok,thx

@patak-dev
Copy link
Member

I was under the assumption that people were using force from the CLI. @asasugar was is your use case to set force in the config? You are trying to avoid the cache from ever generating? This isn't the most efficient way if that is the case because the files would still be written to disk.

@asasugar
Copy link
Author

I was under the assumption that people were using force from the CLI. @asasugar was is your use case to set force in the config? You are trying to avoid the cache from ever generating? This isn't the most efficient way if that is the case because the files would still be written to disk.

I read the documentation of vite v2, and then used vite v3, the force statement reported an error, as @sapphi-red said, config.force instead of config.server.force is ok.

@sapphi-red
Copy link
Member

@asasugar What is the reason for using config.force?

@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants