vue-cli-plugin-quasar icon indicating copy to clipboard operation
vue-cli-plugin-quasar copied to clipboard

TypeScript error in main.ts: "Could not find a declaration file for module './quasar-user-options'."

Open BenJackGill opened this issue 3 years ago • 0 comments

Describe the bug I have a Vue Cli project using TypeScript and the Quasar Plugin.

After installing the plugin I get this TypeScript error in main.ts:

Could not find a declaration file for module './quasar-user-options'. '/Users/my-user-account/Dev/my-project/src/quasar-user-options.js' implicitly has an 'any' type.ts (7016)

This error is showing because the quasar-user-options.js file should actually be quasar-user-options.ts.

After changing the file extension from .js to .ts the error goes away.

To Reproduce Steps to reproduce the behavior:

  1. Create a Vue Cli project with TypeScript support: vue create hello-world
  2. Add the Quasar plugin: vue add quasar
  3. Open main.ts file
  4. See error on the 4th line for "./quasar-user-options";`

Expected behavior There should be no error.

Possible solution

The plugin could detect if the Vue Cli project is using TypeScript, and if so create quasar-user-options.ts not quasar-user-options.js.

If that is not possible there should at least be a note about this manually changing this in the docs.

BenJackGill avatar May 07 '22 22:05 BenJackGill