orbitjs / orbit

Composable data framework for ambitious web applications.
https://orbitjs.com
MIT License
2.33k stars 133 forks source link

Could not find module `@orbit/indexeddb-bucket` #690

Closed bracke closed 5 years ago

bracke commented 5 years ago

Hi

I'm using Orbit with and indexeddb-bucket in an Ember application. After updating Ember to 3.12 I get the folling error on startup:

Could not find module @orbit/indexeddb-bucket

It occurs in app/data-buckets/main.js, in the line importing the indexeddb-bucket library:

import IndexedDBBucket from '@orbit/indexeddb-bucket';

The package is installed:

  "dependencies": {
    "@orbit/indexeddb": "^0.15.25",
    "@orbit/indexeddb-bucket": "^0.15.23",
    "@orbit/jsonapi": "^0.15.25",
    "ember-bootstrap": "^1.2.0",
    "node-sass": "^4.9.0"
  },

and is configured in ember-cli-build.js:

orbit: {
      packages: [        
        '@orbit/indexeddb',
        '@orbit/indexeddb-bucket',
        '@orbit/jsonapi'
      ]
    },

Ember orbit is also installed:

ember-orbit": "^0.16.2

Is there anything obvious i'm doing wrong or a known problem with 3.12 of ember in combination with orbit?

Kind regards Bent Bracke

dgeb commented 5 years ago

Hi @bracke,

I think there are some version incompatibilities here. You should upgrade @orbit/indexeddb, @orbit/indexeddb-bucket, and @orbit/jsonapi to ^0.16.1.

v0.16 of ember-orbit relies upon ember-auto-import for package resolution. You can remove the orbit-specific configuration from ember-cli-build.js.

For a working example of v0.16 of orbit + ember-orbit, see https://github.com/orbitjs/todomvc-ember-orbit

Note that scenario 4 described in the README includes an IndexedDB bucket.

Hope this helps!

bracke commented 5 years ago

Hi @dgeb

Thank you for the quick response.

I have upgraded all orbit packages:

  "ember-orbit": "^0.16.2",
    "@orbit/indexeddb": "^0.16.1",
    "@orbit/indexeddb-bucket": "^0.16.1",
    "@orbit/jsonapi": "^0.16.1"

I have also removed orbit settings from ember-cli-build.

It does not make a difference.

Is there anything I could do to get more debug information e.g. from ember-auto-import?

The packages seem be where they should be:

packages

bracke commented 5 years ago

Going back to Ember 3.3 and Orbit 15.6 solves it. Obviously not a longterm solution ;-)

dgeb commented 5 years ago

@bracke hmmm ... what version of ember-auto-import are you using? Try ^1.5.2 - I think that it wasn't until 1.5.0 that vendor dependencies started to get transpiled.

If that's not it - what happens when you remove the bucket entirely? Does the app fail to resolve a different module? Or is this something particular to this one package?

And of course, it's probably worth completely removing and re-installing all your node_modules if you haven't done so already.

bracke commented 5 years ago

ember-auto-import

That did it! Thank you for your help and for writing orbit.

Kind regards Bent Bracke

dgeb commented 5 years ago

@bracke that's great news - thanks for the update!