Using tsconfig.json baseUrl and paths
See original GitHub issueHi,
I tried to have it work with this package: https://github.com/dividab/tsconfig-paths-webpack-plugin
and this snippet added to preact.config.js
:
config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({ logInfoToStdOut: true })
]
But I get
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at validateString (internal/validators.js:112:11)
at Object.join (path.js:1040:7)
at tryPrefix (/Users/antoine/Workspaces/enseignerleclimat/frontend-next/node_modules/less/dist/less.cjs.js:211:53)
at tryPathIndex (/Users/antoine/Workspaces/enseignerleclimat/frontend-next/node_modules/less/dist/less.cjs.js:270:23)
at tryPrefix (/Users/antoine/Workspaces/enseignerleclimat/frontend-next/node_modules/less/dist/less.cjs.js:268:29)
at ReadFileContext.<anonymous> (/Users/antoine/Workspaces/enseignerleclimat/frontend-next/node_modules/less/dist/less.cjs.js:260:48)
at ReadFileContext.callback (/Users/antoine/Workspaces/enseignerleclimat/frontend-next/node_modules/graceful-fs/graceful-fs.js:123:16)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:250:13)
error Command failed with exit code 1.
when executing yarn dev
I was wondering if this couldn’t be added by default in the config template ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to use paths in tsconfig.json? - Stack Overflow
In your tsconfig, place this param and path to the base file ``` { ... "extends": "./tsconfig.base.json", ... } ``` Then in the...
Read more >TSConfig Reference - Docs on every TSConfig option
A series of entries which re-map imports to lookup locations relative to the baseUrl . There is a larger coverage of paths in...
Read more >Paths and baseUrl in tsconfig.json - Medhat Dawoud
First: baseUrl. Which refers to the directory that you need your application to consider as a root directry or a base url, it's...
Read more >paths and baseUrl | ts-node - TypeStrong · GitHub
You can use ts-node together with tsconfig-paths to load modules according to the paths section in tsconfig.json.
Read more >Add baseUrl and paths in tsconfig.json and jsconfig.json #5645
One of the side-effects of setting baseUrl: "." , is that TypeScript now thinks you can import using an absolute path of "src/Foo"...
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 FreeTop 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
Top GitHub Comments
Glad you solved it.
If you still were interested in adding the plugin to this template, you can make a PR with that change. That way you can run it by the actual maintainers of these templates, and get their thoughts.
I just find out the issue. A
@import
had a non-existing path in one of my less imports. The error is kind of confusing…I introduced this error at the same time I added the
tsconfig-paths-webpack-plugin
. Closing this as non related to this repo.Thanks for your time, have a nice day!