I keep getting an error with making new vue pages for my project. The error is saying:
Vetur can't find tsconfig.json or jsconfig.json in /xxxx/xxxxxx.
What would be the solution to fix this problem?
To create the file :)
See the docs
// tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
// this enables stricter inference for data properties on `this`
"strict": true,
"jsx": "preserve",
"moduleResolution": "node"
}
}
Related
Getting syntax error in vendor.js file while running angular 9 application in IE 11. I've enabled all the polyfills and changed the target to "es5" in tsconfig.json as well.
any help will be appreciated!
package.json
"#angular/core": "~9.0.5",
"#angular/platform-browser": "~9.0.5",
"#ng-idle/core": "^10.0.0-beta.1",
"#ng-idle/keepalive": "^10.0.0-beta.1",
"classlist.js": "1.1.20150312",
"core-js": "^3.8.2",
"zone.js": "^0.10.3"
"typescript": "~3.7.5"
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": ["node_modules/#types"],
"lib": ["es2015", "es5", "es6", "dom"]
}
}
I was getting exact same issue and tried multiple alternatives and options with tsconfig.json, polyfills.ts, package.json, but nothing worked for me.
Finally one solution which made my application to work in IE browser was using one lower version of these dependencies -
"#ng-idle/core": "^9.0.0-beta.1",
"#ng-idle/keepalive": "^9.0.0-beta.1"
Did you change the parameters for lib in tsconfig.json file?
I try to create an Angular 9 application on my side and I found that lib contains the below parameters.
"lib": [
"es2018",
"dom"
]
If you have done some modifications then I suggest you revert those changes to their original values.
To run the newly created Angular 9 application in the IE 11 browser, you just need to set "target": "es5" in tsconfig.json. Other than that no changes required.
Further, you can add polyfills if your project requires them.
If you have added some code or functionality in the application and after that, you are not able to run the application in IE 11 then kindly provide information about it. It can help us understand the issue in a better way.
The problem is that I am not able to use env variables, associated with Vue (Using Typescript, if that makes any difference). When declaring an URL for an endpoint and trying to serve, it just uses localhost, which leads me to believe that something in my setup is not done properly.
I've tried setting it up following Vue's own documentation:
https://cli.vuejs.org/guide/mode-and-env.html#modes
Furthermore I've tryed following this guy, which is excatly what I need:
https://code-maze.com/vuejs-axios-http-environment-files/
I've tried a few more different approaches, all with the same result, but theese two are the most topical ones.
Maybe it has something with my setup in my tsconfig.json to do, but to be honest, I'm not sure where the fault could be.
//tsconfig.json
{
"compilerOptions": {
"outDir": "./built/",
"sourceMap": true,
"strict": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"module": "es2015",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"target": "es5",
"lib": [
"es2016",
"dom"
]
},
"include": [
"./src/"
]
}
I've read some solutions where webpack plays in, but as far as I know this should not be needed, since Vue uses its own web bundling.
Description of the project: My project is downloading to node_module via package.json
Package.json
....
dependencies:{
....
"#myllc/application-core": "git+ssh://git#bitbucket.org/myllc/application-core.git",
"#myllc/application-shared":"git+ssh://git#bitbucket.org/myllc/application-shared.git",
}
....
Gotting error when doing "npm build":
ERROR in ./node_modules/#myllc/application-core/index.ts Module
build failed: Error:
/var/www/frontend-skeleton/node_modules/#myllc/application-core/index.ts is missing from the TypeScript compilation. Please make sure it is in
your tsconfig via the 'files' or 'include' property. The missing file
seems to be part of a third party library. TS files in published
libraries are often a sign of a badly packaged library. Please open an
issue in the library repository to alert its author and ask them to
package the library using the Angular Package Form at
(https:// goo.gl/jB3GVv).
This appear after upgrade from Angular4 to Angular5:
Tsconfig:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"baseUrl": "src",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"lib": [
"es2016",
"dom"
],
"typeRoots": [
"node_modules/#types"
]
}
}
I tried to add
"include": [
"./node_modules/#myllc/**/*"
]
but there appear same error at deeper folder .ts file. Also founding
https://github.com/angular/angular-cli/issues/8284
but nothing solved this error.
What is the solution?
The solution is found in index.ts is not part of the compilation. #8284 by tapaz1 :
2 tsconfig.json files, one at the root of the app, and the other inside the src folder (one level down from the root) named tsconfig.app.json that extends the main tsconfig.json. I explicitly added the package that I needed that wasn't being transpiled by Typescript in the "include" array, and like a lot of people here I was getting the *.spec.ts files included despite having them in "exclude" option, so I removed it from the tsconfig.json. The fix was adding the "exclude" option to the second (extended) tsconfig.app.json file.
tsconfig.app.json:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../dist",
"baseUrl": "./",
"module": "es2015",
"types": []
},
"exclude": [
"../node_modules/your_package/**/*.spec.ts"
]
}
Using IntelliJ Idea 2016.2 I'm encountering this error typing to compile an aurelia project generated with
aurelia_project/generators/binding-behavior.ts(2,52): error TS2307: Cannot find module 'aurelia-cli'.
aurelia cli is plainly in node_modules for both local and global. Given the path should this file even compile? perhaps it should be ignored?
if I understand tsconfig and my idea settings, these shouldn't even be built
{
"compileOnSave": false,
"compilerOptions": {
"sourceMap": true,
"target": "es5",
"module": "amd",
"declaration": false,
"noImplicitAny": false,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"lib": ["es2015", "dom"]
},
"exclude": [
"node_modules"
],
"filesGlob": [
"./src/**/*.ts",
"./test/**/*.ts",
"./typings/index.d.ts",
"./custom_typings/**/*.d.ts"
],
"atom": {
"rewriteTsconfig": false
}
}
au run --watch starts fine
How can I fix this issue so that Idea can build the project without errors?
Your will get the same issue when running the compiler in terminal - neither Idea (https://youtrack.jetbrains.com/issue/WEB-17991) not tsc itself support filesGlob, this is atom-specific option. So all files are compiled. And, as no .d.ts for 'aurelia-cli' can be found in the project, compiler errors are reported.
to work out the issue, you can either change the tsconfig.json to make sure that only need files are compiled, or disable TypeScript compiler and use aurelia to build your project
Add generators folder to exclude list - that folder is used internally by Aurelia CLI(if i remember correctly).
"exclude": [
"node_modules",
"aurelia_project"
],
I am using WebStorm and webpack and since my tsconfig is set to node_modules, WebStorm does not recongnize the paths for any of my modules and thus the TypeScript that is bundled with WebStorm emits errors as you can see in my attachments...
tsconfig.json
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"moduleResolution": "node",
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitHelpers": false,
"sourceMap": true,
"noResolve": false
},
"filesGlob": [
"./**/*.ts",
"!./node_modules"
],
"exclude": [
"node_modules",
"typings"
],
"compileOnSave": true,
"buildOnSave": true
}
Errors in Webstorm:
wondering if there is a way to make Webstorm be Webpack and ng2 aware using TypeScript...
TX
Sean
tx for the reply... it was just fixed in WebStorm latest EA... version 144.3143.5 regards