ember-data-factory-guy
ember-data-factory-guy copied to clipboard
Factory Guy incompatible with Embroider
It appears things are stabilising around Embroider because in the ember-cli 3.25 all newly-created addons will have Embroider testing baked into ember-try by default. I've been experimenting with Embroider and various addons and it appears that ember-data-factory-guy is incompatible with Embroider.
I have a very simple Factory Guy set up in this repo. [Commit adding Embroider + Factory Guy]
When trying to create some factories for a response I get the following error:
vendor.js:22450 Uncaught TypeError: Cannot read property 'build' of undefined
at eval (factory-guy.js:339)
at Array.map (<anonymous>)
at FactoryGuy.buildRawList (factory-guy.js:333)
at FactoryGuy.buildList (factory-guy.js:304)
at __webpack_exports__.default.mockFindAll (exposed-request-functions.js:209)
at __webpack_exports__.default.run (users.js:7)
at eval (scenario.js:19)
at Array.forEach (<anonymous>)
at __webpack_exports__.default.include (scenario.js:19)
at __webpack_exports__.default.run (main.js:14)
It's worth pointing out this is happening in both Embroider "safe" and "optimized" modes.
I'll be looking into this myself but just logging here in case any else comes across the problem.
I need this for the app I work so I'm going to start working on this this week
@patocallaghan any progress on this one by any chance?
@averydev I'm hoping to work on it in the coming weeks
My application is running embroider with ember-data-factory-guy and it seems fine..
It's in compat mode with these settings
return require('@embroider/compat').compatBuild(app, Webpack, {
// https://github.com/embroider-build/embroider#options
staticAddonTestSupportTrees: true,
staticAddonTrees: true,
staticHelpers: false,
staticModifiers: false,
staticComponents: false,
})