Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red Squiggly in freshly initialized Vuetify project #3164

Open
4 tasks done
derekwisong opened this issue Sep 28, 2021 · 1 comment
Open
4 tasks done

Red Squiggly in freshly initialized Vuetify project #3164

derekwisong opened this issue Sep 28, 2021 · 1 comment
Labels

Comments

@derekwisong
Copy link

derekwisong commented Sep 28, 2021

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Linux
  • Vetur version: 0.34.1
  • VS Code version: 1.60.2

Problem

The following code in a fresh Vuetify project shows a red squiggly and Vetur error 2307.

        <v-img
          :src="require('../assets/logo.svg')"
          class="my-3"
          contain
          height="200"
        />

Reproducible Case

  1. create new directory, open in vscode
  2. create new vue 2 project: vue create frontend
  3. add vuetify: cd frontend; vue add vuetify and select default install.
  4. add vetur.config.js to root of vscode directory containing the following and restart the VLS
// vetur.config.js
/** @type {import('vls').VeturConfig} */
module.exports = {
  // **optional** default: `{}`
  // override vscode settings
  // Notice: It only affects the settings used by Vetur.
  settings: {
    "vetur.useWorkspaceDependencies": true,
    "vetur.experimental.templateInterpolationService": true
  },
  // **optional** default: `[{ root: './' }]`
  // support monorepos
  projects: ['./frontend']
}

Screenshot from 2021-09-28 08-53-48

Screenshot of error attached

@yoyo930021
Copy link
Member

yoyo930021 commented Oct 4, 2021

You only need a svg.d.ts file in src folder.

declare module '*.svg';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants