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

[rush] set public-hoist-pattern but vs code not detect? #3324

Closed
leohxj opened this issue Apr 7, 2022 · 2 comments
Closed

[rush] set public-hoist-pattern but vs code not detect? #3324

leohxj opened this issue Apr 7, 2022 · 2 comments

Comments

@leohxj
Copy link

leohxj commented Apr 7, 2022

I have some sub packages whose has phantom dependencies, as usually I will can public-hoist-pattern rules to use it in my apps.

I update common/config/rush/.npmrc , add the public-hoist-pattern rules then run rush update, the common/temp/node_modules have the modules who has been hoisted.

BUT, vs code does't detect those modules, it still "cannot find module or its corresponding type declarations".

PS: as workaround, I manually add those modules as a dependency to project's package.json.

@dmichon-msft
Copy link
Contributor

Even with public-host-pattern, since the node_modules directory is not in the root of the repository, the modules are only resolvable from within external dependencies. If a project depends on them directly, they need to be declared in package.json.

@leohxj
Copy link
Author

leohxj commented Apr 12, 2022

Even with public-host-pattern, since the node_modules directory is not in the root of the repository, the modules are only resolvable from within external dependencies. If a project depends on them directly, they need to be declared in package.json.

Thanks, I have to manually add phantom dependencies in package.json now.

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

3 participants