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

Factory Guy incompatible with Embroider #437

Open
patocallaghan opened this issue Mar 2, 2021 · 4 comments
Open

Factory Guy incompatible with Embroider #437

patocallaghan opened this issue Mar 2, 2021 · 4 comments

Comments

@patocallaghan
Copy link
Collaborator

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.

@patocallaghan
Copy link
Collaborator Author

I need this for the app I work so I'm going to start working on this this week

@patocallaghan patocallaghan mentioned this issue Apr 23, 2021
13 tasks
@averydev
Copy link

@patocallaghan any progress on this one by any chance?

@patocallaghan
Copy link
Collaborator Author

@averydev I'm hoping to work on it in the coming weeks

@Techn1x
Copy link
Contributor

Techn1x commented Jul 5, 2023

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,
})

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

No branches or pull requests

3 participants