Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Issue with Service Worker Pouch Config NPM v 3.10 #832

Closed
donaldwasserman opened this issue Dec 2, 2016 · 9 comments
Closed

Issue with Service Worker Pouch Config NPM v 3.10 #832

donaldwasserman opened this issue Dec 2, 2016 · 9 comments

Comments

@donaldwasserman
Copy link
Contributor

donaldwasserman commented Dec 2, 2016

Expected behavior:
ember serve works

Actual behavior:
ember serve results in Error: ENOENT: no such file or directory, open 'node_modules/ember-pouch/node_modules/pouchdb/dist/pouchdb.js'

Steps to reproduce:
Use npm > 3.0 and run ember serve off master

Screenshots (if applicable):

OS and Browser:
OSx Sierra

details

 ENV.serviceWorker = {
    enabled: true,
    debug: true,
    excludePaths: ['manifest.appcache'],
    swIncludeFiles: [
      'node_modules/ember-pouch/node_modules/pouchdb/dist/pouchdb.js'
    ]
  };

^Need to make the swIncludeFiles configurable with some sort of module fetch concept. I'd be happy to make PR, unless someone has a good solution.

@broerse
Copy link

broerse commented Dec 2, 2016

Don't know much about serviceWorker but pouchdb.js is in the /vendor/pouchdb/pouchdb.js broccoli tree.

@ghost
Copy link

ghost commented Dec 2, 2016

Also encountered this w/ npm 3.5.2. It used to work fine at least at this point in time: 2d473fe

That's what I was based off of before syncing to the latest today.

@broerse
Copy link

broerse commented Dec 2, 2016

@BogdanAlexandru ember-pouch moved from Bower to NPM only.

@donaldwasserman
Copy link
Contributor Author

There's also an unresolved peer dependency issue with pouchdb.js issue with my version of NPM with the latest master commits (that I pulled down yesterday).

The service worker config there is hard-coded to the npm 2.x module layout. I think we can check to see if the pouchdb module exists in the node_modules folder root, then if not use the nested directory.

@broerse
Copy link

broerse commented Dec 2, 2016

ember-pouch itself uses:

var pouchdb = stew.find(path.join(path.dirname(require.resolve('pouchdb')), '..', 'dist'), {
      destDir: 'pouchdb',
      files: ['pouchdb.js']
    });

to find the browserified pouchdb.js

@jkleinsc
Copy link
Member

jkleinsc commented Dec 2, 2016

@broerse I wasn't aware that pouchdb.js is in the /vendor/pouchdb/pouchdb.js broccoli tree. Is pouchdb.memory.js also available there? If it is I could fix the unresolved peer dependency.

@broerse
Copy link

broerse commented Dec 2, 2016

pouchdb.memory.js is not an ember-pouch dependency. I could create a npm ember-cli-pouchdb-memory now that puts it there.

@broerse
Copy link

broerse commented Dec 2, 2016

pouchdb-memory is already a NPM module that you can require. So it seems to be node.js only. Not sure a ember-cli-pouchdb-memory is needed.

@jkleinsc
Copy link
Member

jkleinsc commented Dec 5, 2016

I just committed a fix for this. Basically I added pouchdb as a direct dependency in package.json which means pouchdb.js will consistently be available at node_modules/pouchdb/dist/pouchdb.js (it already was for npm 3.x). I also added pouchdb-core as a dependency to fix the warnings.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants