winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.98k stars 196 forks source link

pnpm compile command fails does not generate needed files if empty providers directory exists #4021

Closed wzslr321 closed 1 year ago

wzslr321 commented 1 year ago

I tried this:

After working on a PR regarding compiler I wanted to test the entire project.

This happened:

It failed on stage @winglang/sdk#compile.

// one of many
@winglang/sdk:compile: 12 import { S3Bucket } from "../.gen/providers/aws/s3-bucket";
@winglang/sdk:compile:                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@winglang/sdk:compile: src/target-tf-aws/website.ts:13:32 - error TS2307: Cannot find module '../.gen/providers/aws/s3-bucket-policy' or its corresponding type declarations.

I expected this:

I expected to compile properly and eventually fail on tests stage.

Is there a workaround?

The workaround is to remove libs/wingsdk/src/.gen/providers directory by hand and run pnpm pre-compile. It then generates missing files, which were not generated, because near-empty providers directory existed before - it didn't check if all needed files are there.

Component

SDK

Wing Version

0.26.8

Node.js Version

v18.17.1

Platform(s)

MacOS

Anything else?

No response

Community Notes

WeepingClown13 commented 1 year ago

I actually got this same error yesterday, figured it was just something on my end. Seems not😅

monadabot commented 1 year ago

Congrats! :rocket: This was released in Wing 0.29.17.