presets
presets copied to clipboard
[CRA] Non-relative imports doesn't work
It seems non-relative imports dont't work when using create-react-app-preset, althought it works with built-in preset (which will be removed at 6.*)
Hi @val-o, can you provide an example that I can test against? I can then work on a fix :)
I have same issue. Unfortunately I cannot provide any examples, but I guess the easiest way to reproduce it is to run npx create-react-app demo --typescript
and then configure tsconfig.json to have baseUrl: "src"
. Any component that has a non-relative path ends up with this issue
TypeError: Cannot read property 'secondary' of undefined at http://localhost:9009/main.1b5867a66c58acd044d5.bundle.js:451:73 at flatten (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:183884:21) at ComponentStyle.generateAndInjectStyles (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:184127:27) at useInjectedStyle (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:184341:120) at useStyledComponentImpl (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:184368:28) at Input__Label (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:184421:12) at renderWithHooks (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:138075:18) at updateForwardRef (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:140090:20) at beginWork (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:141928:16) at HTMLUnknownElement.callCallback (http://localhost:9009/vendors~main.1b5867a66c58acd044d5.bundle.js:123438:14)
@mkinfrared, I just tried that in one of our example projects and it worked as expected.
Can you create a minimal repro repo - or provide more details?