-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Module not found: Error: Can't resolve '@ember-data/tracking/-private' #8296
Comments
@mkszepp I don't think these are related at all, I'm fairly sure embroider/consuming applications need to add an adapter since the tracking package is a v1-addon with a custom |
@runspired is there any workaround? I have tried to create an adapter, the build works fine, but in browser i got this error: ember-cli-build.js:
|
@mkszepp I think if you specify compat adapters you end up having to specify all the data packages because you override the default Map which provides the compat adapters for these iirc |
I have an idea of how to make these "v1 addons masquerading as v2 addons" safer for embroider, will push what I suspect is a fix in a moment. Should mean no compat-adapter is necessary. Embroider doesn't run an addon's The fix TL;DR is that I'll write both a |
looks like after testing this was not enough, embroider apparently can't see the tracking package from within the other ember-data packages when compiling. Unsure why. |
Probably all of the import V1Addon from '../../v1-addon';
export default class VerticalCollection extends V1Addon {
// `@html-next/vertical-collection` does some custom Babel stuff, so we'll let it do it's own thing
customizes(...names: string[]) {
return super.customizes(...names.filter(n => n !== 'treeForAddon'));
}
} |
@runspired Embroider brings already this adapter for export class EmberDataBase extends V1Addon {
// May of the ember-data packages use rollup to try to hide their internal
// structure. This is fragile and it breaks under embroider, and they should
// really move this kind of "build-within-a-build" to prepublish time.
//
// This disables any custom implementation of `treeForAddon`. The stock
// behavior is correct.
customizes(...names: string[]) {
return super.customizes(...names.filter(n => n !== 'treeForAddon'));
}
} There was created a subfolder with adaperts for some EmberData addons https://github.com/embroider-build/embroider/tree/main/packages/compat/src/compat-adapters/%40ember-data This adapters are working with ember data < I have also tried use this adapter for tracking, but it doen't work. Maybe with your pull request, there is not anymore necessary to copy the dist folder, because its copied in an other way. 'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { EmberDataBase } = require('@embroider/compat/src/compat-adapters/ember-data');
const buildFunnel = require('broccoli-funnel');
const mergeTrees = require('broccoli-merge-trees');
class EmberDataCompatAdapter extends EmberDataBase {
get v2Tree() {
return mergeTrees([
super.v2Tree,
buildFunnel(this.rootTree, {
include: ['dist/*'],
}),
]);
}
}
module.exports = function (defaults) {
const app = new EmberApp(defaults, {
// Add options here
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
skipBabel: [
{
package: 'qunit',
},
],
compatAdapters: new Map([['@ember-data/tracking', EmberDataCompatAdapter]]),
});
}; |
Yeah I realized later they need to do the opposite of that. I got it mostly working replacing all the adapters with ones that just let EmberData do it's thing normally. Only issue remaining seems to be the version module, unsure why it's giving me grief of the addon tree is properly running 🤔 That said think the main issue is just a bug in embroider in which it creates artificial node_modules trees inside the tmpdir that don't work for pnpm |
The problem here is that v1 addons don't support the I confirmed that deleting |
@runspired rust-lang/crates.io#5277 now shows "Expected store.createRecordDataFor to be implemented but it wasn't" with v4.9.1 which, according to #8296 (comment), appears to be related to this? I guess we should reopen the issue? 😅 |
@Turbo87 probably a new issue, as we only saw that when trying to manually replace the compat adapters. may be related to ember-source tbh as we added test coverage that is passing for embroider. It fails (though with a different error) if we try to bump to 4.9 ember-source. |
@runspired this bug is still present in the |
yes, this is an artifact of how npm works. To publish an updated dist-tag you need a new version. So promoting it to lts bumps the version.
yes, I haven’t had time to port the work backwards but if you’d like that work faster and don’t want to use 4.9 then opening a PR cherry-picking those fixes to the lts-4-8 branch would speed this up. |
you can also use something like |
https://github.com/rust-lang/crates.io/actions/runs/3408161209/jobs/5668483713
Reproduction
see rust-lang/crates.io#5277
Description
It looks like the most recent v4.8 release can't be built with embroider anymore due to the error below:
The text was updated successfully, but these errors were encountered: