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

[bug] Build failure with @glimmer/tracking with ember beta 3.27.0-beta.1 + ember-cli-babel >= 7.24.0 #733

Open
lukemelia opened this issue Mar 25, 2021 · 5 comments

Comments

@lukemelia
Copy link
Contributor

With embroider (0.37), ember beta 3.27.0-beta.1, and ember-cli-babel >= 7.24.0...

The @glimmer/tracking module is output into the intermediate build directory without any javascript and the build then fails when your app code tries to import { track } from '@glimmer/tracking';.

Minimal reproduction: https://github.com/lukemelia/tracking-build-issue-with-ember-beta

➜  tracking-build-issue-with-ember-beta git:(master) ✗ ember build
Environment: development
⠹ building... [OneShot > Babel: ember-fetch > applyPatches]Building into /private/var/folders/y4/k85wgqy15pggcrmxns0z20pc0000gn/T/embroider/c85199
cleaning up...
Build Error (PackagerRunner) in controllers/index.js

Module not found: Error: Can't resolve '@glimmer/tracking' in '$TMPDIR/embroider/c85199/controllers'
@rwjblue
Copy link
Collaborator

rwjblue commented Mar 25, 2021

This sounds a lot like the issue that I fixed by making @glimmer/tracking an addon (glimmerjs/glimmer.js#306) but your demo is already using @glimmer/[email protected].

@lukemelia
Copy link
Contributor Author

This sounds a lot like the issue that I fixed by making @glimmer/tracking an addon (glimmerjs/glimmer.js#306) but your demo is already using @glimmer/[email protected].

I tried it with 1.0.4 as well and the behavior is the same.

@ef4
Copy link
Contributor

ef4 commented Mar 29, 2021

@rwjblue making glimmer/tracking an empty addon will help with the auto-import case, but yeah, it's going to break embroider.

@glimmer/tracking looks like a good candidate for conversion to a v2 addon. That would solve both builds.

@ef4
Copy link
Contributor

ef4 commented Mar 29, 2021

Oh, I'm remembering more about why glimmer/tracking works like it does. Under ember it actually does nothing, right? The real implementation is in Ember itself. The stuff in the real package is for glimmerjs only.

The problem here is that it's neither entirely virtual (like @ember/component) nor entirely real (like @glimmer/component). It's trying to be both, and that's just... too weird.

I think it would be easiest to give it a real implementation, even that implementation just looks up the one from ember and returns it, like:

// @glimmer/tracking/addon/index.js
try {
  // on ember > 3.27 there's a real module
  return window.require('@glimmer/tracking')
} catch (err) {
  return Ember._tracked;
}

@void-mAlex
Copy link
Collaborator

hello @lukemelia doing a little housekeeping here and wondering if this is still an issue or if it can be closed

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

4 participants