s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 179 forks source link

Object is possibly 'undefined' error? #574

Open ccorcos opened 6 years ago

ccorcos commented 6 years ago

I have a rather bizarre issue where I'm getting errors when building with webpack. But I'm not seeing any errors when I run tsc. Not sure what's up with this or how to minimally reproduce. I'm still migrating to webpack 4. Any ideas?

ccorcos commented 6 years ago

I figured it out!

Whenever I await a promise inside Promise.all, I get this error.

    const [user, space] = await Promise.all([
        await postgres.getRecordValue(UserSchema.table, userId, true),
        await postgres.getRecordValue(SpaceSchema.table, spaceId, true),
    ])