My Vue 2.2.3 application is experiencing difficulties in the build process due to 4 TypeScript-related errors that are perplexing me.
This is the error output displayed on the console:
Failed to compile with 4 errors 6:08:46 PM
error in node_modules/vue/types/jsx.d.ts:39:7
TS1110: Type expected.
37 | * https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
38 | */
> 39 | [v: `--${string}`]: string | number | undefined
| ^^^^^
40 | }
41 |
42 | type Booleanish = boolean | 'true' | 'false'
...
(error details repeated for all 4 errors)
ERROR Error: Build failed with errors.
I followed a link provided in the console to address the issue and included the recommended code snippet in my project's source directory.
// My css.d.ts file
import type * as CSS from 'csstype';
declare module 'csstype' {
interface Properties {
// Add a missing property
WebkitRocketLauncher?: string;
// Add a CSS Custom Property
'--theme-color'?: 'black' | 'white';
// ...or allow any other property
[index: string]: any;
}
}
Despite adding the aforementioned file, the TypeScript errors persist. I attempted removing
'--theme-color'?: 'black' | 'white';
but it did not resolve the issue either.
I am currently at a loss on how to troubleshoot these problems and successfully complete the build process. Interestingly, the app builds without issues on my production server.
It should be noted that Veutify is also being used, which could potentially contribute to some of these errors.
Any assistance would be greatly valued.