vue-storefront
vue-storefront copied to clipboard
void' is not assignable to type '(callback: Function)
Package
@vue-storefront/[email protected]
Current behavior
When incremental compilation checks are added to path packages/core/core a compilation error is produced on the file at "packages/core/core/src/utils/ssr/index.ts"
Error
semantic error TS2322: Type '(fn: () => void) => void' is not assignable to type '(callback: Function) => void'. Types of parameters 'fn' and 'callback' are incompatible. Type 'Function' is not assignable to type '() => void'. Type 'Function' provides no match for the signature '(): void'.
Root Cause
When the package's tsconfig is configured to perform strict null checks, this issue / error is surfaced.
Additional Consideration
The resulting changes to the type system and lines of code are somewhat complex and add bytes to the overall package, which may not inherently add value if there is appropriate test coverage to ensure that the scripts and features work.
On the other hand, resolving the issue does provide a code base that better adheres to the Typescript standards and practices.
Expected behavior
Compilation would complete without error
Steps to reproduce the issue
- Navigate to tsconfig at "packages/core/core/src/utils/ssr/index.ts"
- Set compiler option "strictFunctionTypes" to true
- Execute compilation on package at "packages/core/core"
Version of Vue Storefront
- [ ] Vue Storefront
- [X] Vue Storefront Next
Can you handle fixing this bug by yourself?
- [x] YES
- [ ] NO
Which Release Cycle state this refers to? Info for developer. (doesn't apply to Next)
Pick one option.
- [ ] This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from
developbranch and create Pull Request2. Feature / Improvementback todevelop. - [ ] This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - [ ] This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.
Environment details
[email protected] [email protected] [email protected] IDE@[email protected]
Additional information
None