Typescript path alias not working
See original GitHub issueIn my tsconfig.json
I set a path alias but when I execute quasar dev
I get the following output:
These dependencies were not found:
* @/components/admin/admin in ./src/router/routes.ts
* @/components/admin/box-plan/box-plan.component.vue in ./src/router/routes.ts
....
This is my complete tsconfig.json
:
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"quasar"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
],
"typeRoots": [
"src/types",
"node_modules/@types"
],
},
"include": [
"src/**/*.ts",
"src/**/*.vue"
],
"exclude": [
"node_modules"
]
}
OS: macOS Catalina (10.15.2) Node: v10.16.3 NPM: 6.9.0
Before I moved to Quasar, this app was built by a Vue CLI app and the Typescript Configuration worked as expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Why are these tsconfig paths not working? - Stack Overflow
In case anyone is using VSCode and having trouble getting the /* solution to work. Try Cmd+Shift+P > Typescript: Restart TS Server. –...
Read more >Typescript — How to solve the problem with unresolved path ...
Generally, what should be done can be summarized as follows: Take a look into tsconfig.json and check if there are path aliases defined...
Read more >Typescript – How to solve the problem with unresolved path ...
Generally, what should be done can be summarized as follows: Take a look into tsconfig.json and check if there are path aliases defined...
Read more >path configuration aliases not working with nested folders.
Hello the typescript compiler seems unable to resolve path aliases when targeting subfolders. I'm using typescript v3.0.1 and my current ...
Read more >How to configure and resolve path alias with a Typescript Project
The project will start without issues here! running javascript code with path alias. How to resolve a Typescript path alias with ts-node. With ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@IlCallo Thanks a lot for your help. This worked:
@jeoy (and futur reference), you also need to add them to the electron section
the “build” section is only for the “src/” folder, the other 2 in the picture is for electron-main .ts and electron-preload.ts