-
Notifications
You must be signed in to change notification settings - Fork 137
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
Error when using [email protected] with staticAddonTrees enabled #396
Comments
This may have to do with the work being done to make @ember-data/model optional. @runspired ? |
@Gaurav0 its due to embroider doing special sauce things for EmberData that it should not be doing. There’s a way for embroider users to opt out. |
Yes, older versions of ember-data broke under embroider so there's a compat adapter. But the new versions work and don't need the adapter and the adapter breaks them. Try this as a workaround until I can release a version that does this automatically: const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
compatAdapters: new Map([['ember-data', null]])
}); |
Thanks for the response. I've changed it to add |
I managed to get this working with You can try the workaround with the following
This change seemed to have an effect on the
My best guess is that the tooling doesn't like that the |
I had the same issue with ember-data 3.18, and the above comment/hack fixed it for me |
also, this works, if not using the meta package: compatAdapters: new Map([
['@ember-data/debug', null],
['@ember-data/model', null],
['@ember-data/store', null],
['@ember-data/record-data', null],
]), probably just However, this does not work (with these specific options: return compatBuild(app, Webpack, {
extraPublicTrees: additionalTrees,
staticAddonTestSupportTrees: true,
staticAddonTrees: true, // having this enabled requires that we use the EmberDataCompatAdapter custom class
staticHelpers: true,
staticComponents: true,
// splitAtRoutes: true,
// skipBabel: [],
packageRules: [
{
package: 'ember-intl',
semverRange: '^4.3.2',
addonModules: {
'services/intl.js': {
dependsOnModules: ['../adapters/default.js']
}
}
},
],
compatAdapters: new Map([
['@ember-data/model', null],
['@ember-data/model', null],
['@ember-data/store', null],
['@ember-data/record-data', null],
]),
}); |
@NullVoxPopuli enabling Unfortunately, things like Embroider has a solution for these in the long term (the embroider spec introduces conditional imports that it understands) but we don't use these in EmberData yet as we need to support the traditional ember-cli environment. Our plan is to convert to them once it is possible (which may already be the case but wasn't when I last examined). |
i think this problem was solved in embroider 1.2. (see https://github.com/embroider-build/embroider/blob/v1.2.0/CHANGELOG.md#v120-2022-02-10 / pull request #1124) |
Seems like the issue is still there. I'm on ember-data version 4.4. None of the solutions above help.
|
Hi,
when enabling
staticAddonTrees
in an app that uses[email protected]
, I'm seeing an error being thrown:Reproduction repo: https://github.com/makepanic/embroider-data-staticAddonTrees
If this issue is better tracked in the ember-data repo, I can reopen it there.
The text was updated successfully, but these errors were encountered: