Comments (5)
How would this be fixed with [email protected]
and [email protected]
? It seems that the problem is still present and ember-engines/resolver
has been removed. Which deprecates the fix proposed above.
from ember-engines.
Sounds like an issue with how the test's Resolver
is set up. In tests/test-helper.js
you should see a call to setResolver
, this sets the Resolver
instance that is used by Integration/Unit tests, by default it pulls in a resolver from tests/helpers/resolver.js
that looks something like:
import Resolver from '../../resolver';
import config from '../../config/environment';
const resolver = Resolver.create();
resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};
export default resolver;
You'll want to make sure the Resolver
class it is importing is extended from ember-engines/resolver
(or, more ideally, is the same Resolver
used by your Engine). Additionally, you'll probably need to update modulePrefix
to be the same as whatever your Engine's modulePrefix
is (looks like testmanager-engine
) otherwise it'll likely be the dummy
namespace (assuming this is an Addon).
So in other words, make sure the Resolver
is looking in the proper namespace for your component.
Bonus tip: the reason you see A helper named 'foo-component' could not be found.
is that during rendering of templates, Ember first attempts to resolve Handlebars constructs as Components and then Helpers. So, if a Component is not found (as in this case) it tries to resolve it as a Helper, but if no Helper is found it'll throw the error you are seeing.
from ember-engines.
For anyone else encountering this issue:
- tests/dummy/app/resolver.js should be extended from
ember-engines/resolver
modulePrefix
in tests/helpers/resolver.js should be set to the samemodulePrefix
as your engine
We haven't thought of a way to avoid hard-coding modulePrefix
inside of tests/helpers/resolver.js, but the above steps resolve this issue at least
from ember-engines.
Thanks for the update @cklimkowsky
We haven't thought of a way to avoid hard-coding modulePrefix inside of tests/helpers/resolver.js, but the above steps resolve this issue at least
As of ember-engines v0.2.5 (from the v0.2 branch), you should be able to import the same config/environment
into both your addon/engine.js
and your tests/helpers/resolver.js
, and then access its value as config.modulePrefix
. In other words, you should no longer need to hard-code modulePrefix
in multiple places. Note: if you're using Ember Canary, you can also have this same benefit by using the ember-engines clean
branch, which is soon to merge with master
.
from ember-engines.
@dgeb we can import it everywhere without issues EXCEPT in tests/helpers/resolver.js
; that is still throwing errors on the vanilla unit test Ember generates with a route:
Promise rejected before it exists: Attempting to register an unknown factory: 'route:plans/new'
We are using Ember 2.7.0-canary :-/
from ember-engines.
Related Issues (20)
- Pod style with tailwind inside in-repo engine doesn't processed correctly HOT 3
- [RFC] Deprecate `{ 'engine-service': 'host-service' }` syntax for service dependencies HOT 1
- Lazy loading changes output path of assets HOT 1
- [RFC] Provide `externalRouter` to Engines HOT 5
- `@embroider/macros` macro conditions can sometimes be evaluated incorrectly HOT 1
- Unknown object passed to sourceOfConfig() error HOT 6
- How to install an addon in an engine? HOT 2
- getOwner doesn't return the context for the route HOT 3
- cannot find module "@ember/routing/link-component" in ember ~4.1 HOT 2
- Class extends value [object Object] is not a constructor or null HOT 3
- Could not find module `@ember/legacy-built-in-components` HOT 2
- error reading "inaccessibleByURL" is undefined sometimes
- build error after upgrading to 0.9.0 HOT 3
- Service dependencies do not pass through properly in embedded engine (Ember 3.28) HOT 3
- Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'on') HOT 1
- dependencies do not pass through properly in embedded engine under single spa
- 0.8.22 breaks compatability with Ember > 3.24 HOT 2
- Transitioning from one engine route to another triggers a Cannot read properties of undefined (reading 'shouldSupersede')
- Rebuild crash on Ember 4.12.1 apps - Ember CSS file HOT 1
- Getting ember-source dependency conflict with ember-source 5.3 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-engines.