Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

build-ts cannot find module #23

Open
nionis opened this issue Jul 9, 2018 · 5 comments
Open

build-ts cannot find module #23

nionis opened this issue Jul 9, 2018 · 5 comments

Comments

@nionis
Copy link
Contributor

nionis commented Jul 9, 2018

When using yarn within lerna, with useWorkspaces: true, yarn will attempt to hoist the packages, this resulted on my end issues where typescript would complain about the paths (since they are hoisted at root node_modules), and also build failing

By disabling workspaces and using lerna bootstrap --nohoist it was working fine,
I am not sure if I should be experiencing this issue since you will have noticed it by now, any clues?

@shrugs
Copy link
Member

shrugs commented Jul 16, 2018

I've updated the README with the commands I use to run the project locally

# in one terminal
yarn run watch-ts

# in another in //packages/gnarly-bin
yarn run ts-start

let me know if that helps. My PATH has ./node_modules/.bin in it, and lerna symlinks //packages/gnarly-bin/node_modules/.bin/ts-node to the version in gnarly-core.

let me know if that helps?

@nionis
Copy link
Contributor Author

nionis commented Jul 21, 2018

I have re-cloned the project and retried and it seems to be okay right now, no issues, it seems running watch-ts for first time (before lib folders are created) will show something like
@xlnt/gnarly-reducer-events: src/reducer.ts(14,8): error TS2307: Cannot find module '@xlnt/gnarly-core'.

I guess its because they run in parallel, once lib folders are created there are no issues

@shrugs
Copy link
Member

shrugs commented Jul 21, 2018

Ah! That makes sense. What's the best way to handle that? I expect other projects have run into the same when using lerna with transpiled js.

@shrugs
Copy link
Member

shrugs commented Aug 10, 2018

this has been fixed as a side effect of the new references links in the various tsconfig files that were added in #49

@shrugs shrugs closed this as completed Aug 10, 2018
@shrugs
Copy link
Member

shrugs commented Aug 10, 2018

Actually, still got the issue locally. Running build-ts twice naturally fixes the issue. Will keep this open. Will most likely be fixed as part of #37

@shrugs shrugs reopened this Aug 10, 2018
@shrugs shrugs changed the title lerna bootstrap vs yarn bootstrap build-ts cannot find module Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants