feathers-plus / feathers-offline-realtime

Offline-first realtime replication, with optimistic updates while connected.
MIT License
33 stars 9 forks source link

npm install on deployed version fails / "debug" module is missing: "src/ doesn't exist" #19

Closed bitflower closed 4 years ago

bitflower commented 6 years ago

Steps to reproduce

EDIT / TLDR;

I have commented out all requires and uses of debugmodule and now it works: feathers_debug

I've added the module to a @stencil/core app with an import statement. Rollup is trying to bundle things up but fails. I then commented out all lines of code in your module until I found out that this line fails:

var _debug = require('debug');

inside base-replicator.js.

Looking at the mode_modules of your module it indeed is missing.

Then I tried to npm install inside your module which gave me the error below.

Expected behavior

  1. I can import the module into an app that uses a web bundler, in my case rollup.
  2. I can npm install on the distributed npm package without error

Actual behavior

npm install on the deployed version of the module gives me this:

> npm run compile

> feathers-offline-realtime@0.1.2 compile /Users/matthias/Documents/Projekte/bitflower/Case OS/Prototype/v0.2/caseos-ui/node_modules/feathers-offline-realtime
> shx rm -rf lib/ && babel -d lib/ src/

src/ doesn't exist
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! feathers-offline-realtime@0.1.2 compile: `shx rm -rf lib/ && babel -d lib/ src/`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the feathers-offline-realtime@0.1.2 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthias/.npm/_logs/2018-02-09T12_49_47_873Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! feathers-offline-realtime@0.1.2 prepublish: `npm run compile`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the feathers-offline-realtime@0.1.2 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/matthias/.npm/_logs/2018-02-09T12_49_47_963Z-debug.log

System configuration

Tell us about the applicable parts of your setup. The module is part of a Stencil (Ionic hybrid apps) app.

Module versions (especially the part that's not working):

{
  "_from": "feathers-offline-realtime",
  "_id": "feathers-offline-realtime@0.1.2",
  "_inBundle": false,
  "_integrity": "sha1-BQvY+HuJTZ8f/3pGhhLgO6aJXZs=",
  "_location": "/feathers-offline-realtime",
  "_phantomChildren": {},
  "_requested": {
    "type": "tag",
    "registry": true,
    "raw": "feathers-offline-realtime",
    "name": "feathers-offline-realtime",
    "escapedName": "feathers-offline-realtime",
    "rawSpec": "",
    "saveSpec": null,
    "fetchSpec": "latest"
  },
  "_requiredBy": [
    "#USER",
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/feathers-offline-realtime/-/feathers-offline-realtime-0.1.2.tgz",
  "_shasum": "050bd8f87b894d9f1fff7a468612e03ba6895d9b",
  "_spec": "feathers-offline-realtime",
  "_where": "/Users/matthias/Documents/Projekte/bitflower/Case OS/Prototype/v0.2/caseos-ui",
  "author": {
    "name": "Feathers contributors",
    "email": "hello@feathersjs.com",
    "url": "https://feathersjs.com"
  },
  "bugs": {
    "url": "https://github.com/feathersjs/feathers-offline-realtime/issues"
  },
  "bundleDependencies": false,
  "contributors": [],
  "dependencies": {
    "component-emitter": "1.2.1",
    "debug": "^2.6.8",
    "feathers-commons": "0.8.7",
    "feathers-errors": "2.8.1",
    "feathers-offline-snapshot": "^0.0.1",
    "feathers-query-filters": "2.1.2",
    "md5": "2.2.1",
    "shortid": "2.2.8",
    "uberproto": "1.2.0",
    "uuid": "3.1.0"
  },
  "deprecated": false,
  "description": "Offline-first realtime replication with optimistic updates.",
  "devDependencies": {
    "babel-cli": "^6.24.1",
    "babel-core": "^6.24.1",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-preset-es2015": "^6.24.1",
    "chai": "^4.0.0",
    "feathers": "^2.1.3",
    "feathers-hooks": "^2.0.1",
    "feathers-memory": "^1.1.0",
    "istanbul": "^1.1.0-alpha.1",
    "mocha": "^3.4.2",
    "semistandard": "^11.0.0",
    "shx": "^0.2.2"
  },
  "directories": {
    "lib": "lib"
  },
  "engines": {
    "node": ">= 4.6.0"
  },
  "homepage": "https://github.com/feathersjs/feathers-offline-realtime",
  "keywords": [
    "feathers",
    "feathers-plugin"
  ],
  "license": "MIT",
  "main": "lib/",
  "name": "feathers-offline-realtime",
  "repository": {
    "type": "git",
    "url": "git://github.com/feathersjs/feathers-offline-realtime.git"
  },
  "scripts": {
    "changelog": "github_changelog_generator && git add CHANGELOG.md && git commit -am \"Updating changelog\"",
    "compile": "shx rm -rf lib/ && babel -d lib/ src/",
    "coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --opts mocha.opts",
    "lint": "semistandard src/**/*.js test/**/*.js --fix",
    "mocha": "mocha --opts mocha.opts",
    "prepublish": "npm run compile",
    "publish": "git push origin --tags && npm run changelog && git push origin",
    "release:major": "npm version major && npm publish",
    "release:minor": "npm version minor && npm publish",
    "release:patch": "npm version patch && npm publish",
    "start": "npm run compile && node example/app",
    "test": "npm run compile && npm run lint && npm run coverage",
    "watch": "babel --watch -d lib/ src/"
  },
  "semistandard": {
    "sourceType": "module",
    "env": [
      "mocha"
    ]
  },
  "version": "0.1.2"
}

NodeJS version: 8.9.4

Operating System: macOS 10.13.3

Browser Version: Chrome 64

Module Loader: rollup (@stencil/core)

eddyystop commented 6 years ago

Run npm install debug inside @ feathers-plus/feathers-offline-realtime .

The Feathers Auk standards are src/ exists on GitHub only and contains the ES2015 source. lib/ exists only on npm and contains the ES5 code produced by Babel.

bitflower commented 6 years ago

Hey, so if I use a bundler that expects ES6 modules I should npm install from github URL?

eddyystop commented 6 years ago

I would think so.

On Fri, Feb 9, 2018 at 9:37 AM, Matthias Max notifications@github.com wrote:

Hey, so if I use a bundler that expects ES6 modules I should npm install from github URL?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/feathers-plus/feathers-offline-realtime/issues/19#issuecomment-364450824, or mute the thread https://github.com/notifications/unsubscribe-auth/ABezn5_E1wcvQ9AmqQEqOitnFgPvfZlhks5tTFgOgaJpZM4R_4lA .