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

Issue with TypeScript declaration files #205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jasongerbes
Copy link

@jasongerbes jasongerbes commented Jun 16, 2022

This PR demonstrates an issue with the TypeScript declaration files produced by tsc.

See the related Nx issue: nrwl/nx#10765

Steps to reproduce:

  1. Run nx build lib-2.
  2. Open dist/libs/lib-2/src/lib/test.d.ts.
  3. Observe the broken import from dist.

Example of test.d.ts:

// dist/libs/lib-2/src/lib/test.d.ts
export declare const test: import("../../../../dist/libs/lib-1/src").TestFunction;

This issue doesn't occur when the file includes any (unrelated) imports from @nx-example/lib-1.

For example, lib-2/src/lib/test-2.ts imports the unrelated testValue from @nx-example/lib-1, which then causes TestFunction to be correctly imported (despite not being directly imported in test-2.ts):

// dist/libs/lib-2/src/lib/test-2.d.ts
export declare const test: import("@nx-example/lib-1").TestFunction;

@nx-cloud
Copy link

nx-cloud bot commented Jun 16, 2022

@netlify
Copy link

netlify bot commented Jun 16, 2022

Deploy Preview for nrwl-nx-examples-dep-graph ready!

Name Link
🔨 Latest commit 0d7679f
🔍 Latest deploy log https://app.netlify.com/sites/nrwl-nx-examples-dep-graph/deploys/62aab543d5eaa20008f0ed96
😎 Deploy Preview https://deploy-preview-205--nrwl-nx-examples-dep-graph.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

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

Successfully merging this pull request may close these issues.

None yet

2 participants