Buildable library foo fails to build when it imports buildable library bar.
Per the incremental builds page, importing a buildable library into another buildable library should result in a successful build.
Repro repo: https://github.com/mikechabot/lib-foo-depends-on-lib-bar
npx create-nx-workspace my-test-orgnpm install --save-dev @nrwl/reactnx generate @nrwl/react:library --name=foo --buildable --pascalCaseFilesnx generate @nrwl/react:library --name=bar --buildable --pascalCaseFileslibs/foo/src/lib/Foo.tsx<Bar /> from "@my-test-org/bar". nx build foo --withDeps --skip-nx-cachenx run build:bar -> Successnx run build:foo -> FailAlthough there are no buildable libs in the nx-examples example repo, I created some buildable libs, and submitted the PR here: https://github.com/nrwl/nx-examples/pull/120
It's the rootDir issue, which appears to be a common/recurring problem. It appears this issue has not been addressed for React.
> nx run foo:build
Bundling...
Error during bundle: Error: C:/_workspaces/my-test-org/libs/foo/src/lib/Foo.tsx(4,19): semantic error TS6059: File 'C:/_workspaces/my-test-org/libs/bar/src/index.ts' is not under 'rootDir' 'C:/_workspaces/my-test-org/libs/foo/src'. 'rootDir' is expected to contain all source files.
Bundle failed.
NX Report complete - copy this into the issue template
nx : Not Found
@nrwl/angular : Not Found
@nrwl/cli : 10.3.1
@nrwl/cypress : 10.3.1
@nrwl/eslint-plugin-nx : 10.3.1
@nrwl/express : Not Found
@nrwl/jest : 10.3.1
@nrwl/linter : 10.3.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 10.3.1
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.1
@nrwl/web : 10.3.1
@nrwl/workspace : 10.3.1
typescript : 4.0.5
@FrozenPandaz Hey there, just checking in for any possible updates; I'd pushing for my org to adopt this tech stack, but unfortunately this is a blocker. Let me know if there's anyway I can help diagnose the issue.
Just linking this here, to have these connected #3518
Hi there @mikechabot ! Thanks for filing this bug. We are looking into it! :)
@mikechabot I'm working on a fix for this. So to unblock you in the meantime. Change the name prop of the package.json of the buildable libs to their actual TS path, like
bar => @my-test-org/barfoo => @my-test-org/foothat should make it work. Sorry for the inconvenience. I'll try to release a fix for this asap