Skip to content

Could not find module when running host application in ember engines setup #314

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

Closed
allenz-crypto opened this issue Sep 18, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@allenz-crypto
Copy link
Contributor

Having installed ember-cli-typescript in both app and engine, and running the app, it cannot find the ts module defined in the engine.

It works when running from the engine dummy app.

Steps to reproduce: https://github.com/allenylzhou/yarn-workspaces-ember-engine

yarn version 1.6 / node version 8.11.1
OR
yarn version 1.7 / node version 8.12.0

loader.js:247 Uncaught Error: Could not find module `my-new-engine/utils/random` imported from `my-new-engine/components/some-input`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at Class._extractDefaultExport (index.js:422)
    at Class.resolveOther (index.js:101)
    at Class.resolve (index.js:163)
    at _resolve (container.js:820)
    at Registry.resolve (container.js:570)
@mike-north
Copy link
Contributor

assigning this to @dfreeman since he's been most involved with recent monorepo/workspaces efforts

@dfreeman dfreeman added the bug label Sep 19, 2018
@dfreeman
Copy link
Member

Hi @allenylzhou — I see a couple of things in that project that will prevent it from working with ember-cli-typescript as it stands today.

The first is that we don't support lazy engines—ember-engines and ember-cli-typescript both break out of a number of the normal flows for the Ember CLI build process, and in this instance not in compatible ways. The second is that we have a known incompatibility in our out-of-the-box setup with yarn workspaces (see #234). To my knowledge no one has had the chance yet to dig in and understand where the root cause of that issue lies.

We're hoping to revamp the whole build system in this addon in the near future (#287 has another example of why and a bit of information on what we're thinking of), which should solve both problems.

@chriskrycho
Copy link
Member

@dfreeman circling back on this now that we've landed all the expected build changes—would you expect this all to work now, as I would?

@allenylzhou can you try this by installing ember-cli-typescript@next?

@chriskrycho chriskrycho added this to the v2.0 stable milestone Feb 16, 2019
@dfreeman
Copy link
Member

Yes, I think I'd expect things to work as they would in pretty much any vanilla TS project at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants