Closed zanza00 closed 7 years ago
Try adding: "moduleResolution": "node"
to your tsconfig.json
compilerOptions. That should ensure module names like components/SimpleDiv
are resolved
Also, if you are only working with JavaScript, try changing your tsconfig.json
to a jsconfig.json
. When you use a TypeScript project, you have to manually manage typings files. JavaScript projects do much of this automatically: https://code.visualstudio.com/Docs/languages/javascript#_automatic-type-acquisition
Thanks for the response and sorry for the delay.
I tried to change the file from tsconfig
to jsconfig
but it work way worse (don't resolve anything at all)
if I use moduleResolution: node
and indeed code navigation works for components/SimpleDiv
, code completions doesn't work.
looking at the documentation of typescript i found this block about baseUrl and I have updated the example repo and with the following tsconfig.
{
"compilerOptions": {
"target": "ES6",
"allowSyntheticDefaultImports": true,
"jsx": "react",
"allowJs": true,
"moduleResolution": "node",
"baseUrl": ".",
"paths": {
"*": [
"*",
"app/*"
]
}
},
"include": [
"app/*"
]
}
My issues are:
Code Completion (ctrl+space) doesn't works at all, not for SimpleComponent, SimpeDiv and npm modules[it display a list of words from the document]. It doesn't works with messages
either (it's a relative import).
Code navigation (cmd+click) works for SimpleComponent and Simplediv but not for npm modules
if I completely remove tsconfig and restart code I have code completion for npm packages but not for my code inside app
Any other suggestions that I can try?
Try changing the include
section to:
"include": [
"app/**/*.js"
]
The include paths are globs so app/*
will only expand to files directly under app
. You can check if a file is part of your jsconfig
project by running the JavaScript: Go to Project Configuration
command in the file
Here's the jsconfig.json
I used:
{
"compilerOptions": {
"target": "ES6",
"allowSyntheticDefaultImports": true,
"jsx": "react",
"module": "commonjs",
"baseUrl": ".",
"paths": {
"*": [
"*",
"app/*"
]
}
},
"include": [
"app/**/*.js"
]
}
Thanks for the response, with my example repo it work flawlessly 😄 (nice trick the Go to project configuration
)
Sadly if I open my App, which is considerably larger and with more files it will function for a brief moment but after that doesn't works
if I open tsserver.log it raises this exception
Info 38 Received response: {"projectName":"/Users/simonepicciani/dev/clients/neat-webapp/jsconfig.json","typeAcquisition":{"enable":true,"include":[],"exclude":[]},"compilerOptions":{"allowJs":true,"maxNodeModuleJsDepth":2,"allowSyntheticDefaultImports":true,"skipLibCheck":true,"target":2,"jsx":2,"module":1,"baseUrl":"/Users/simonepicciani/dev/clients/neat-webapp","paths":{"*":["*","app/*"]},"configFilePath":"/Users/simonepicciani/dev/clients/neat-webapp/jsconfig.json","allowNonTsExtensions":true},"typings":["/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/chalk/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/compression/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/express/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/fontfaceobserver/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/immutable/dist/immutable-nonambient.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/invariant/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ip/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/minimist/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-dom/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-helmet/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-intl/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-motion/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-redux/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-router/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-router-redux/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/redux/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/redux-immutable/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/redux-saga/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/reselect/src/reselect.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/styled-components/typings/styled-components.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/warning/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-core/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/cheerio/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/copy-webpack-plugin/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/enzyme/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/html-webpack-plugin/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/jest/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-addons-test-utils/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/rimraf/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/shelljs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/sinon/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/webpack/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/webpack-dev-middleware/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/webpack-hot-middleware/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/ajv/lib/ajv.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/html-minifier/node_modules/camel-case/camel-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/change-case/change-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/param-case/param-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/constant-case/constant-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/dot-case/dot-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/iconv-lite/lib/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/is-lower-case/is-lower-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/is-upper-case/is-upper-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/lower-case/lower-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/lower-case-first/lower-case-first.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/no-case/no-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/pascal-case/pascal-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/path-case/path-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/postcss/d.ts/postcss.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/pretty-error/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/raf/node_modules/performance-now/src/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/rxjs/Rx.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/sentence-case/sentence-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/snake-case/snake-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/swap-case/swap-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/symbol-observable/index.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/title-case/title-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/upper-case/upper-case.d.ts","/Users/simonepicciani/dev/clients/neat-webapp/node_modules/upper-case-first/upper-case-first.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/accepts/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/acorn/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ansi-styles/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/app-root-path/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/are-we-there-yet/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/argparse/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/array-find-index/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/array-uniq/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/assert-plus/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/async/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/autoprefixer/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/aws4/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/glob/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-code-frame/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-generator/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-template/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-traverse/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babel-types/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/babylon/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/base64-js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/big.js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/semver/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/bl/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/bluebird/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/boom/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/brorand/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/browser-resolve/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/resolve/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/buffers/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/bytes/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/camelcase/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/camelcase-keys/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/object-assign/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/supports-color/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/chokidar/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/circular-json/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/classnames/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/clean-css/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/commander/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/source-map/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/clone/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/color/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/colors/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/combined-stream/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/concat-stream/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/content-disposition/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/content-type/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/convert-source-map/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/cookie/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/cookie-signature/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/core-js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/dateformat/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/debug/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/decamelize/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/through2/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/vinyl/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/deep-equal/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/deep-extend/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/del/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/depd/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/detect-indent/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/diff/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/doctrine/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/duplexer2/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ejs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/once/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/enhanced-resolve/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/entities/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/error-stack-parser/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/es6-weak-map/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/escape-html/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/escape-string-regexp/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/escodegen/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/estraverse/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/strip-bom/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/memory-fs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/tapable/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/esprima/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/extend/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/fast-levenshtein/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/file-type/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/finalhandler/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/findup-sync/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/form-data/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/fs-extra/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/node-uuid/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/get-stdin/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/glob-base/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/glob-stream/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/graceful-fs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/gulp-rename/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/gulp-sourcemaps/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/gulp-util/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/handlebars/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/he/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/history/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/hoek/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/html-entities/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/html-minifier/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/htmlparser2/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/http-errors/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/indent-string/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/inherits/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ini/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/inquirer/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/intl-messageformat/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ip-regex/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-absolute-url/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-binary-path/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-finite/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-my-json-valid/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-path-cwd/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-path-in-cwd/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-plain-object/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-promise/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-url/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/is-windows/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/isomorphic-fetch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/js-yaml/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ms/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/minimatch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/js-base64/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/jsbn/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/jsdom/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/qs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/request/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/sax/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/uuid/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/jsesc/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/json-schema/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/json-stable-stringify/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/json5/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/klaw/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/leven/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/load-json-file/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/loader-runner/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/path-exists/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash-es/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.assignin/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.assignwith/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.bind/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.camelcase/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.defaults/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.escape/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.filter/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.flatten/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.foreach/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.get/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.indexof/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isarguments/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isarray/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isempty/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isequal/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isplainobject/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.isstring/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.keys/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.mapvalues/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.merge/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.pick/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.pickby/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.reduce/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.reject/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.some/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lodash.template/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lolex/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/lru-cache/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/meow/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/merge-descriptors/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/merge-stream/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/micromatch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/mime/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/mime-db/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/mime-types/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/mkdirp/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/mkpath/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/node-dir/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/node-fetch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/node-int64/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/node-notifier/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/nopt/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/number-is-nan/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/on-finished/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/on-headers/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/optimist/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ora/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/os-homedir/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/os-locale/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/os-tmpdir/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/pako/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/parse-glob/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/parseurl/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/path-is-absolute/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/path-parse/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/pify/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/pluralize/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/prelude-ls/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/progress/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/prop-types/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/q/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/query-string/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/range-parser/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/rc/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/react-side-effect/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/relateurl/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/replace-ext/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/resolve-from/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/rx/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/rx-lite/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/send/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/serve-static/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/shallowequal/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/source-list-map/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/source-map-support/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/sprintf/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/sprintf-js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/sshpk/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/statuses/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/strip-ansi/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/strip-json-comments/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/swiper/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/table/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/tar/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/tempfile/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/text-encoding/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/through/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/tmp/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/touch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/tough-cookie/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/traverse/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/type-check/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/ua-parser-js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/uglify-js/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/window-size/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/yargs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/uniq/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/url-regex/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/user-home/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/utils-merge/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/verror/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/vinyl-fs/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/watch/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/watchpack/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/webpack-sources/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/which/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/wrap-ansi/index.d.ts","/Users/simonepicciani/Library/Caches/typescript/2.4/node_modules/@types/xtend/index.d.ts"],"unresolvedImports":["!file-loader?name=[name].[ext]!.","!file-loader?name=[name].[ext]!.","!file-loader?name=[name].[ext]!.","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","assets","file-loader?name=[name].[ext]!.","sanitize.css","utils","utils","utils","utils","utils","utils","utils","utils","utils","utils","utils"],"kind":"action::set"}
Err 39 Exception on executing command unknown:
Project '/Users/simonepicciani/dev/clients/neat-webapp/jsconfig.json' does not contain document '/users/simonepicciani/library/caches/typescript/2.4/node_modules/parse5/node_modules/@types/node/index.d.ts'
Error: Project '/Users/simonepicciani/dev/clients/neat-webapp/jsconfig.json' does not contain document '/users/simonepicciani/library/caches/typescript/2.4/node_modules/parse5/node_modules/@types/node/index.d.ts'
at Object.ThrowProjectDoesNotContainDocument (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:75718:23)
at ConfiguredProject.Project.getScriptInfoForNormalizedPath (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:77238:42)
at ConfiguredProject.Project.getScriptInfo (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:77243:29)
at ModuleBuilder.AbstractBuilder.getOrCreateFileInfo (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76551:51)
at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76679:84
at Object.map (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:1483:29)
at ModuleBuilder.getReferencedFileInfos (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76679:31)
at ModuleBuilder.updateFileReferences (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76708:42)
at ModuleBuilder.ensureProjectDependencyGraphUpToDate (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76693:30)
at ModuleBuilder.onProjectUpdateGraph (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:76684:22)
I tried on my linux machine with the stable and it works so it's the insider version for sure. (same result if i disable all the extensions)
Hmm, can you please check to see if the file /users/simonepicciani/library/caches/typescript/2.4/node_modules/parse5/node_modules/@types/node/index.d.ts
exists?
Also, as workaround, try disabling automatic type acquisition by adding:
"typeAcquisition": {
"enable": false
}
to your jsconfig.json
or by setting "typescript.disableAutomaticTypeAcquisition": true
in your vscode user settings.
A final step to try is deleting the entire /users/simonepicciani/library/caches/typescript/
directory. Perhaps the typings cache got into a bad state?
The file exists, I erased all of the ts cache library without any luck, disabled type acquisition in the json file, nothing seems to works.
Then I tried starting vscode without extension and it worked! 🎉 Even the type acquisition 😄 Now it's working with the extensions. (Maybe I have some extension that sometimes breaks the type acquisition?)
Anyway thanks for the invaluable help.
@mjbvz I have an update.
I don't know why but if i install with yarn
it doesn't works, if I use npm i
it does work.
with npm i
I don't have the error in the tsserver.log about @types/node
node: v8.1.3 npm: v5.2.0 yarn: v0.27.5
In my case, the problem was I had installed eslint only locally through yarn. After installing it also globally, it worked.
UPDATE: Found recipe in closed issue, so question is non-actual
Too complicated. Can I ask the same thing, but in the short? I added an resolve option to webpack.config.js to get a shortened imports work:
import TestService from ‘services/test-service’
instead of:
import TestService from ‘../../../../services/test-service’
But now VSC autocomplete not work when I type TestService later. How to fix that without applying entire another's jsconfig.json? What is the one-two line/option solution?
Thanks.
Yes, configuring the paths
in the tsconfig
or jsconfig
is our current story for supporing webpack alaises. If you do not already have a tsconfig
or jsconfig
, try searching online for a starting one and then modify it as needed.
The @types error is a duplicate of #30425. Should be fixed in VSCode 1.14.2
Steps to Reproduce:
yarn
ornpm i
app/containers/HomePage
SimpleDiv
app
, restarting tsserver does not resolve the problemReproduces without extensions: Yes
I have tried a lot of combinations in the
tsconfig.json
but I was not able to make it works with code completion from npm (react, PropTypes, lodash) and from my code fromapp
if I use the
path
options and put node_modules inside it kinda works.Also if I am doing something wrong let me know.
Thanks in advance