simondotm / nx-firebase

Firebase plugin for Nx Monorepos
https://www.npmjs.com/package/@simondotm/nx-firebase
MIT License
175 stars 31 forks source link

Module '@mymono/typescript-interfaces' Not Found #120

Closed aureliopetrone closed 1 year ago

aureliopetrone commented 1 year ago

I'm encountering an issue where the module '@mymono/typescript-interfaces', which is a buildable package containing TypeScript interfaces, cannot be found or its corresponding type declarations.

Steps to reproduce:

Installed nx Installed latest version of simondotm/nx-firebase Attempted to import { Activity } from "mymono/typescript-interfaces"

Error Message

Cannot find module '@mymono/typescript-interfaces' or its corresponding type declarations.

6 import { Activity } from "@mymono/typescript-interfaces"
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior:

The 'mymono/typescript-interfaces' module should be found and the application should compile without errors.

Additional context:

The 'mymono/typescript-interfaces' is a buildable package containing TypeScript interfaces. If there's any further information required or if I've missed any steps that might cause this issue, please let me know.

Node : 16.16.0 OS : darwin arm64 yarn : 3.4.1

nx : 15.3.3 @nrwl/angular : Not Found @nrwl/cypress : 15.3.3 @nrwl/detox : 15.3.3 @nrwl/devkit : 15.3.3 @nrwl/esbuild : Not Found @nrwl/eslint-plugin-nx : 15.3.3 @nrwl/expo : Not Found @nrwl/express : 15.3.3 @nrwl/jest : 15.3.3 @nrwl/js : 15.3.3 @nrwl/linter : 15.3.3 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : 15.3.3 @nrwl/nx-cloud : 15.3.3 @nrwl/nx-plugin : Not Found @nrwl/react : 15.3.3 @nrwl/react-native : 15.3.3 @nrwl/rollup : 15.3.3 @nrwl/schematics : Not Found @nrwl/storybook : Not Found @nrwl/web : 15.3.3 @nrwl/webpack : 15.3.3 @nrwl/workspace : 15.3.3 typescript : 4.9.5

Local workspace plugins:

Community plugins: @simondotm/nx-firebase: 1.0.0

simondotm commented 1 year ago

This sounds like a workspace config issue rather than a plugin issue. Check your typescript-interfaces library was created with --importPath=@mymono/typescript-interfaces

aureliopetrone commented 1 year ago

I have 4 apps in the monorepo (and around 10 libraries) building fine that uses that shared library. Is "--importPath=@mymono/typescript-interfaces" necessary only for nx-cloud?

aureliopetrone commented 1 year ago

So, I found the issue. In project.json inside the typescript shared lib, this is not working:

Screenshot 2023-06-25 at 15 06 15

If you remove "rootDir" it start to working.

Screenshot 2023-06-25 at 15 06 27

I wonder why the rest of the packages were building fine. Is it because they didn't need the compiled library but the original typescript one?

simondotm commented 1 year ago

Yeah thats odd. I've rarely, if ever, seen rootDir set in a project config. Just a thought, but perhaps if your other packages are using bundlers, they probably just use the source Typescript to build rather than the compiled JS so would be unaffected by this setting.

Glad you got it sorted. FWIW there'll be a new 2.0 version of the firebase plugin soon that no longer needs libraries to be buildable. 👍