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

typescript cannot be found for type check on windows #65

Closed
RyanHow opened this issue Jan 26, 2021 · 1 comment · Fixed by #70
Closed

typescript cannot be found for type check on windows #65

RyanHow opened this issue Jan 26, 2021 · 1 comment · Fixed by #70
Labels
bug Something isn't working

Comments

@RyanHow
Copy link

RyanHow commented Jan 26, 2021

Windows 10

npx create-serverless-stack@latest myapp --language typescript
cd myapp
npx sst build

following error

Running type checker
Error: There was a problem finding typescript
    at getBinPath (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:45:11)
    at typeCheck (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:210:9)
    at runChecks (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:236:48)
    at prepareCdk (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:362:9)
There was a problem type checking the source.

I changed @serverless-stack\cli\scripts\util\cdkHelpers.js:40 from filePath.match(/(^.*\/node_modules)\/.*$/); to filePath.match(/(^.*[\/\\]node_modules)[\/\\].*$/); and it works

After this fixed then I get another issue

Type checking Lambda function source

TypeError: Cannot read property 'toString' of undefined
    at App.typeCheck (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:263:28)
    at C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:193:12
    at Array.forEach (<anonymous>)
    at App.processInputFiles (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:190:38)
    at App.synth (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:159:12)
    at process.<anonymous> (C:\working\myapp\node_modules\@aws-cdk\core\lib\app.ts:123:45)
    at Object.onceWrapper (events.js:421:26)
    at process.emit (events.js:314:20)
    at process.emit (C:\working\myapp\node_modules\source-map-support\source-map-support.js:495:21)

There was an error synthesizing your app.
@jayair jayair added the bug Something isn't working label Jan 27, 2021
@jayair jayair added this to the Add Other Constructs milestone Jan 27, 2021
@jayair
Copy link
Contributor

jayair commented Jan 27, 2021

Thanks for taking a crack at fixing it. I'll take a look at this for the next release.

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

Successfully merging a pull request may close this issue.

2 participants