Skip to content

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

Open
@BenJackGill

Description

@BenJackGill

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions