steida / actualtasks

Local, minimal, key navigable tasks.
https://actualtasks.com
MIT License
11 stars 0 forks source link

Type SetAppState can not be imported in Circle CI #15

Closed steida closed 5 years ago

steida commented 5 years ago

Locally, it works. But in Circle CI:

#!/bin/bash -eo pipefail
yarn test
yarn run v1.5.1
$ run-s lint tsc build
$ tslint -p .
$ tsc
packages/web/hooks/useAppState.ts:3:29 - error TS2307: Cannot find module '@app/shared/lib/appState/AppStateContext'.

3 import { SetAppState } from '@app/shared/lib/appState/AppStateContext';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/web/pages/me.tsx:16:20 - error TS7031: Binding element 'viewer' implicitly has an 'any' type.

16     setAppState(({ viewer }) => {
                      ~~~~~~

packages/web/pages/me.tsx:31:20 - error TS7031: Binding element 'viewer' implicitly has an 'any' type.

31     setAppState(({ viewer }) => {
                      ~~~~~~

Found 3 errors.

error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c tsc
Directory: /home/circleci/repo
Output:

Check web useAppState hook.

steida commented 5 years ago

Omg. It's because Webpack treats exported type as real type.

https://github.com/babel/babel-loader/issues/603#issuecomment-399293448