question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

declaration of 'server.force' error

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sapphi-redcommented, May 30, 2022

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.

0reactions
sapphi-redcommented, May 31, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript compiler does not throw error on missing declaration
Compiler does not throw an error to me that I am using undeclared variable a . But if I try to export some...
Read more >
PL/SQL RAISE Exceptions By Practical Examples
Learn how to use the PL/SQL RAISE statement to raise a user-defined exception, internally defined exception, and reraising an exception.
Read more >
Node.js Error Handling Best Practices: Ship With Confidence
Want to ship your Node.js applications with confidence? Learn Node.js error handling best practices, tips and tricks with our simple guide.
Read more >
@@ERROR (Transact-SQL) - SQL Server | Microsoft Learn
Returns an error number if the previous statement encountered an error. If the error was one of the errors in the sys.messages catalog...
Read more >
Puppet Duplicate declaration error - Server Fault
i'm running in an Error: Duplicate declaration with my puppet project. I want to deploy jboss instances, and part of them are some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found