Skip to content
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

Accessing Models using require() will no longer work on ember-data v5 #2503

Closed
Pixelik opened this issue Aug 2, 2023 · 1 comment · Fixed by #2542
Closed

Accessing Models using require() will no longer work on ember-data v5 #2503

Pixelik opened this issue Aug 2, 2023 · 1 comment · Fixed by #2542

Comments

@Pixelik
Copy link

Pixelik commented Aug 2, 2023

Screenshot 2023-08-01 at 13 35 12

Instead of accessing a Model with:

// ember-cli-mirage/ember-data.js

let modelName = matches[1];
let model = require(path, null, null, true).default

It will now be accessed with:

// ember-cli-mirage/ember-data.js

let modelName = matches[1];
let model = application.__container__.lookup('service:store').modelFor(modelName)
@acorncom
Copy link
Collaborator

And per #2445 the idea of auto-discovering models for ED will probably go away as well

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