Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack could not deduce aliases from TS / JS config file. #12168

Open
laxsuryavanshi opened this issue Mar 14, 2022 · 3 comments
Open

Webpack could not deduce aliases from TS / JS config file. #12168

laxsuryavanshi opened this issue Mar 14, 2022 · 3 comments

Comments

@laxsuryavanshi
Copy link

Describe the bug

After setting up, and using path mappings in tsconfig.json file, webpack gives module resolution error.

Module not found: Error: Can't resolve '@module' in '/path/frontend/src/file'
 @ ./src/App.tsx 7:0-46 22:30-42
 @ ./src/index.tsx 7:0-24 11:33-36

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

Webpack resolve, alias
Typescript path mappings
Module not found: Error: Can't resolve '@module' in 'path/to/file'

Environment

Using yarn v1.22.17
Node: v14.17.6
OS: MacOS 12.2.1
CPU: Apple M1

Steps to reproduce

  1. yarn create react-app frontend --template typescript
  2. Add baseUrl and paths to compilerOptions in tsconfig.json file
  3. yarn start

Expected behavior

Webpack should get module aliases from tsconfig.json file.

Actual behavior

Webpack gives Module not found error.

@siva-444
Copy link

+1
Same here

@nanhaibo
Copy link

nanhaibo commented Apr 6, 2022

+1
the same

@dmfarcas
Copy link

dmfarcas commented Nov 9, 2022

...and my axe!

yea, same here. the technology to add aliased imports isn't there yet, it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants