craco icon indicating copy to clipboard operation
craco copied to clipboard

When using @alias imports, CRA v3.0.1 will fail in TypeScript production builds in CI

Open euanmillar opened this issue 7 years ago • 1 comments

Craco is awesome to support @alias paths. But with CRA v3.0.1 an annoying warning is generated when running a production build that will cause CI to throw an error when using TypeScript.

aliased imports are not supported

This is because of line 132 in: react-scripts/scripts/utils/verifyTypeScriptSetup.js

paths: { value: undefined, reason: 'aliased imports are not supported' },

Resolving this seems out of the scope of Craco as it happens before the webpack build.

Leaving a solution here in case somebody needs it.

Install patch-package and comment out the line!

Hope this helps.

This will not be necessary when eventually CRA supports @aliases as they say that they intend to.

euanmillar avatar Jun 11 '19 10:06 euanmillar

@euanmillar Do you have a source for the CRA team stating they intend to support @Aliases?

someguynamedmatt avatar Sep 05 '19 21:09 someguynamedmatt