You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 19, 2022. It is now read-only.
const CracoAlias = require('craco-alias');
const path = require('path');
module.exports = {
plugins: [
{
plugin: CracoAlias,
options: {
source: 'tsconfig',
// baseUrl SHOULD be specified
// plugin does not take it from tsconfig
baseUrl: './src',
// tsConfigPath should point to the file where "baseUrl" and "paths" are specified
tsConfigPath: '../../tsconfig.paths.json',
},
},
],
};
I have an import in apps/web/src/App.tsx:
`import '@web/common/axiosSetup';`
The file axiosSetup is located inside apps/web/src/common/axiosSetup.ts
And when I run I get following error:
@program-studio/web: > @program-studio/[email protected] start
@program-studio/web: > craco start
@program-studio/web: The following changes are being made to your tsconfig.json file:
@program-studio/web: - compilerOptions.paths must not be set (aliased imports are not supported)
@program-studio/web: [HPM] Proxy created: / ->
@program-studio/web: [HPM] Proxy created: / ->
@program-studio/web: ℹ 「wds」: Project is running at
@program-studio/web: ℹ 「wds」: webpack output is served from
@program-studio/web: ℹ 「wds」: Content not from webpack is served from
@program-studio/web: ℹ 「wds」: 404s will fallback to /
@program-studio/web: Starting the development server...
@program-studio/web: Failed to compile.
@program-studio/web: ./src/App.tsx
@program-studio/web: Module not found: Can't resolve '@web/common/axiosSetup' in '/Users/edubskiy/Dev/work/program-studio/apps/web/src'
So I am trying to import code inside my app/web/src folder with absolute path using alias
Please tell me what do I do wrong and how do fix import?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have monorepo with following structure (using lerna):
|_ api // nodejs
|_ web // react app
|_ common // common code between react and nodejs
|_ components // common components between react apps
at the root of monorepo I have tsconfig.paths.json:
and apps/web/tsconfig.json:
and also apps/web/craco.config.js
I have an import in apps/web/src/App.tsx:
The file axiosSetup is located inside apps/web/src/common/axiosSetup.ts
And when I run I get following error:
So I am trying to import code inside my app/web/src folder with absolute path using alias
Please tell me what do I do wrong and how do fix import?
The text was updated successfully, but these errors were encountered: