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

Import error when importing json file in Vue, with checkJs enabled #68363

Closed
DevMcC opened this issue Feb 10, 2019 · 1 comment
Closed

Import error when importing json file in Vue, with checkJs enabled #68363

DevMcC opened this issue Feb 10, 2019 · 1 comment
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@DevMcC
Copy link

DevMcC commented Feb 10, 2019

  • VSCode Version: 1.31.0
  • OS Version: Windows 10

Issue:
I just started adding a jsconfig.json file to my project and I've enabled the checkJs option.
One of my Vue components is importing a json file, but the editor is showing me a Cannot find module error.

Steps to Reproduce:

  1. Configure a jsconfig.json file, see below.
  2. Make a Vue component.
  3. Have the component import a json file.
  4. See the import underlined with an error - Cannot find module.

Does this issue occur when all extensions are disabled?: Yes

jsconfig.json:

{
    "compilerOptions": {
        "baseUrl": "./src/",
        "checkJs": true,
        "paths": {
            "@/*": ["./*"]
        },
        "resolveJsonModule": true
    },
    "include": [
        "src"
    ]
}

Additional info:

  • Importing a js file works fine.
  • Importing a json file from a js file works fine.
@octref
Copy link
Contributor

octref commented Feb 12, 2019

resolveJsonModule is not available until TS 2.9, follow vuejs/vetur#682.

@octref octref closed this as completed Feb 12, 2019
@octref octref added the *caused-by-extension Issue identified to be caused by an extension label Feb 12, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

2 participants