Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rspack in react app cannot resolve deep-imports from a monorepo library #349

Open
Nick-Lucas opened this issue Nov 20, 2023 · 1 comment

Comments

@Nick-Lucas
Copy link

A common pattern with Nx is to have a library with its imports not in the main index.ts, this is achieved just by adding a glob path to tsconfig.json

"paths": {
  "@org/lib": ["libs/lib/src/index.ts"],
  "@org/lib/*": ["libs/lib/src/*"]
}

When using rspack though, this seems to not work, as it can't resolve the import:

// works
import { a } from "@org/lib";

// FIXME: this import fails at build-time as unresolvable
import { bar } from "@org/lib/test-import";
image

Minimal reproduction here, it's just 1 app 1 lib and 1 deep import: https://github.com/Nick-Lucas/nx-spack-import-repro

@Nick-Lucas Nick-Lucas changed the title rspack in react app fails cannot resolve deep-imports from a monorepo library rspack in react app cannot resolve deep-imports from a monorepo library Nov 20, 2023
@VugarAhmadov
Copy link

any solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants