-
Notifications
You must be signed in to change notification settings - Fork 319
-
Notifications
You must be signed in to change notification settings - Fork 319
typescript with next & absolute imports breaks vs code integration #136
Comments
I've created a repository and an SO question to accompany this issue |
closing b/c i've somehow fixed this, though unclear on what did it. for wayward googlers, here's my relevant
and in
I am not sure why this wasn't working initially. I cleared any settings having to do with typescript & added |
It seems baseUrl from tsconfig.json doesn't apply at all. Only module-resolver in .babelrc matters. |
The baseUrl needs to be configured in
Should we reopen this issue to drive that forward? |
Quick note for any Googlers for whom @brandonmp 's config doesn't work - don't forget that when you have a You need to specify an
|
When I upgraded to Next.js 9 and removed
|
Hie. I'm using nextjs 9.0.5, react 16.9.0, and babel-plugin-module-resolver 3.2.0... I've tried all the solutions above and I still cannot get it to work. Below are files
What am I missing? |
Solved it by adding the baseUrl and paths in the complierOptions like this
|
Next config file
And tsconfig file
Please help. |
This may be a Code / Typescript issue, but wanted to post here in case anyone's solved it.
Has anyone been able to make absolute import paths work with
next-typescript
without losing VS Code module resolution?Currently using absolute imports via
babel-plugin-module-resolver
, but whenever I callimport Whatever from 'absolute/whatever'
, Code reports that the 'Cannot find the module' (relative imports work fine).Project builds fine, but editor integration would be clutch.
Have tried:
path
andbaseUrl
props intsconfig.json
config.resolve.alias
innext.config.js
module-aliases
in lieu of the babel pluginBut nothing seems to make the editor resolve paths correctly.
relevant versions
The text was updated successfully, but these errors were encountered: