Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Typescript fails to compile when including unmock as a package dependency #383

Closed
mikesol opened this issue Feb 12, 2020 · 0 comments · Fixed by #384
Closed

Typescript fails to compile when including unmock as a package dependency #383

mikesol opened this issue Feb 12, 2020 · 0 comments · Fixed by #384
Assignees
Labels
bug Something isn't working

Comments

@mikesol
Copy link

mikesol commented Feb 12, 2020

Description

Unmock fails to compile because of a type import

Steps to Reproduce

  • Include unmock as a package dependency
  • Run tsc

Expected Result

Should compile.

Actual Result

Fails with this error:

node_modules/unmock-node/dist/backend.d.ts:2:37 - error TS2307: Cannot find module 'unmock-core/src/interceptor'.
2 import { IInterceptorFactory } from "unmock-core/src/interceptor";

Additional Context

To fix the bug, I'd recommend hoisting all imports to a top-level namespace. As the src directory is not packaged (only the dist one is), unmock-node cannot find unmock-core/src.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant