-
Notifications
You must be signed in to change notification settings - Fork 1
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
Import not resolving in new Ember app #3
Import not resolving in new Ember app #3
Comments
@richard-viney - Can you throw together a quick demo repo that I can poke at? I think I know what is going on, but having the |
I think emberjs/ember-cli-babel#337 will fix. |
OK, I think if you ensure that you have [email protected] it should work properly. Please let me know if that doesn't fix it... https://github.com/babel/ember-cli-babel/releases/tag/v7.20.0 |
Thanks for looking into this. I'm still seeing this with
Repo that shows the problem is here: https://github.com/richard-viney/ember-cache-primitive-polyfill-import-error. All dependencies are on the latest stable versions. A |
Hmph. OK, thank you, I'm sorry I really thought that would have resolved it 🤔 |
I hit the same issue, but it happened suddenly after working all day O_O I dug in a bit and I'm not entirely sure what is supposed to make the import work in the first place though. fwiw I have |
Interesting, I never had it work here, but am currently working around the issue by using |
@richard-viney I was about to try that, but it seems weird that the polyfill infra just isn't working. |
Somehow it started working again after I fiddled around a bit with the declared module I wrote in a I made this change: - module "@glimmer/tracking/primitives/cache" {
+ declare module "@glimmer/tracking/primitives/cache" { I suspect it's a red herring, but who knows. |
Here's the log. I see https://gist.github.com/wycats/a8cb76a4d23d36ff7217a30b953e1a3f |
Same issue here. I am trying to use it from an addon. |
It looks like this is being caused by |
I can confirm that removing |
FWIW, I ran into a similar thing, though it was a runtime error ( |
This makes sense, thanks for shedding light on that @simonihmig! Basically, without a sufficiently recent ember-cli-babel version we aren't guaranteed that the module import will be transpiled into |
It's good that some folks are managing to make this error disappear, but the original repro steps are still working for me here even with an upgrade to |
I am seeing the same issue. Was working great and then all of a sudden stopped working - and I'm still on |
@rwjblue I'd be happy to set up some time to try to pair our way through this. I've experienced it a bunch and I think it's just a matter of digging deeply into it. |
I'm still seeing the same error when removing this package and trying to use the cache primitive API present in |
@richard-viney - Can you confirm that the app or addon that is attempting to import is using at least [email protected]? Support was added for this import path in that version emberjs/ember-cli-babel#337 (but is possible to get via transitive dependency drift with others). |
Yep the app's
There are probably some other addons in use that specify older versions of |
What matters is the thing that is doing the |
Yep it's just in a source file under the A clone,
|
Ya, the issue here is that The quickest fix for your app is to exclude // ember-cli-build.js
let app = new EmberApp(defaults, {
autoImport: {
exclude: ['@glimmer/tracking'],
}
}); |
I just confirmed ^ in a demo app that I made to repro as well. |
Great, that all makes sense. Though won't most apps that try to use this feature end up with this error given that both ember-auto-import and @glimmer/tracking are in the default blueprint? Or maybe the app blueprint includes the above change in the ember-cli 3.22 betas (I haven't checked to confirm if this is the case). |
Yes. I wasn't saying that I thought my work around was acceptable 😉, just that it would unblock folks currently stuck. I'm working through the permutations to account for the issue without user interaction/changes/etc... |
@richard-viney - I just confirmed that using |
I've also landed a helpful warning for folks using older @glimmer/tracking versions, just to make sure folks aren't getting a super obtuse error without any meaningful feedback. |
Thanks, looks good! |
Great work @rwjblue. Out of curiosity, what was the exact interaction? |
@wycats - Basically, because the app has a devDep on |
The suggested import isn't working when trying this out. Attempting to import gives the following:
Error: Can't resolve '@glimmer/tracking/primitives/cache'
Steps to reproduce:
ember new test-app
(With Ember CLI 3.18.0)cd test-app
ember install ember-cache-primitive-polyfill
import { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';
toapp/app.js
.ember serve
Then the error above appears.
I'm on macOS 10.15.4; Node.js 10.20.1; Ember.js 3.18.
Thanks!
The text was updated successfully, but these errors were encountered: