Skip to content

Cannot find module './src/transform-inline/visitor-utils' or its corresponding type declarations #93

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

Closed
shhac opened this issue Mar 10, 2021 · 3 comments

Comments

@shhac
Copy link

shhac commented Mar 10, 2021

Upgrading from 0.17.1 to 0.18.0/0.18.1 can no longer build my project under ttsc

  • Issue seems to be around visitor-utils
  • To reproduce you'll need to delete your node_modules and re-install dependencies e.g. by running npm ci
  • Using Node 14.15.3
    "build": "ttsc",
...
    "ttypescript": "^1.5.12",
    "typescript": "^4.2.3"
Found '/Users/paul/Projects/Api2/.nvmrc' with version <14>
Now using node v14.15.3 (npm v6.14.10)

> [email protected] build /Users/paul/Projects/Api2
> ttsc

node_modules/typescript-is/index.d.ts:1:35 - error TS2307: Cannot find module './src/transform-inline/visitor-utils' or its corresponding type declarations.

1 import {TemplateLiteralPair} from './src/transform-inline/visitor-utils';
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `ttsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/paul/.npm/_logs/2021-03-10T14_29_34_563Z-debug.log

There isn't a log identifying which file specifically typescript-is doesn't like from within my project 😞

@joshAg
Copy link

joshAg commented Mar 17, 2021

this is the line with the error: https://github.com/woutervh-/typescript-is/pull/92/files#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8R1

@woutervh-
Copy link
Owner

Thanks guys, I found that the issue was indeed with the import, and copied the type into index.d.ts.

Released version v0.18.2 https://github.com/woutervh-/typescript-is/releases/tag/v0.18.2

@DetachHead
Copy link
Contributor

that's funny, i found this issue just a few minutes before you pushed this fix.

seems like it was due to the fact that an index.ts isn't compiled as part of the ts project, but instead two separate index.d.ts and index.js files. i tried to fix this but it seems to be set up this way because the function signatures need to be different to the actual functions? i wonder if there's a cleaner solution to this issue.

in the mean time i removed the offending type from visitor-utils.ts as it's now in index.d.ts. though i'm not sure if other files importing from index is a good idea either

see #94

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

4 participants