NX.dev – Problems with buildable libraries.

We are building a shared UI platform for one of our clients where we decided to store the code in a monorepo and use nx.dev to help us with the code organisation, dependencies, builds, etc.

When trying to set up the common libraries of the project as publishable (and buildable) libs, we run into compilation problems – nx.dev tried to load JS files (that were non-existent) instead of the TSX files.

We ended up removing everything that was generated as buildable and publishable using js:lib, and re-generating it as non-buildable and non-publishable libs, using workspace:lib instead.

After doing these changes we got the Buildable libraries cannot import or export from non-buildable lint rule warning for one of our libraries.

It turned out that we had a leftover build rule in one of the library’s project.json. After removing all the library build scripts, and restarting VSCode the issue seems to be resolved.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.