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

Migrating to v0.13 causes issue #205

Closed
vpezeshkian opened this issue Dec 10, 2016 · 7 comments
Closed

Migrating to v0.13 causes issue #205

vpezeshkian opened this issue Dec 10, 2016 · 7 comments
Labels

Comments

@vpezeshkian
Copy link

First I uninstalled global nwb, then installed it locally.
when doing so npm ls nwb threw peer dependency error babel-core was missing, so it wouldn't start on {path to nwb module}\nwb.js serve.
Then I npm installed it as peer dependency and it starts to work.

However when Jenkins build the project, I receive the following error:
Error: Cannot find module '{path to project}/node_modules/babel-runtime/helpers/extends' from {path to project}/lib/wc-workspace

Is there anything I do wrong while migrating?

Thanks.

@vpezeshkian vpezeshkian changed the title Migration to v0.13 causes issue Migrating to v0.13 causes issue Dec 10, 2016
@insin insin added the support label Dec 11, 2016
@insin
Copy link
Owner

insin commented Dec 11, 2016

The babel-core error is a bit weird, not sure what's happening there. I would try uninstalling and reinstalling nwb from scratch first to make sure all dependencies are there.

Is there any extra configuration in your nwb.config.js file?

Does anything look out of place in the generated Webpack config if you set a DEBUG=nwb environment variable?

Does your project structure much different from what nwb's skeleton app creates? It looks like you're running serve from a nested directory.

A relevant change in 0.13 could be that we now specify the path to babel-runtime when creating Babel config, so it would be useful to see what that gets set to using debug output.

@vpezeshkian
Copy link
Author

One thing I noticed just now which is not good is that modules are required with absolute path with ./node_modules/nwb/lib/bin/nwb.js build and also ./node_modules/nwb/lib/bin/nwb.js build --set-env-NODE_ENV=production

var _extends2 = require('/Users/{my-user-name}/projects/{my-project}/node_modules/babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _classCallCheck2 = require('/Users/{my-user-name}/projects/{my-project}/node_modules/babel-runtime/helpers/classCallCheck');
And more...

Notice that I removed global nwb and running the command from node_modules, is that the correct way of running if there is no global nwb installed?

@vpezeshkian
Copy link
Author

vpezeshkian commented Dec 12, 2016

Yea, this is a bug I believe in 0.13.x.
So I decided to try one more time with globally installed nwb, now the output is pointing to where global nwb is installed

var _extends2 = require('/usr/local/lib/node_modules/nwb/node_modules/babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = require('/usr/local/lib/node_modules/nwb/node_modules/babel-runtime/helpers/classCallCheck');
And more...

EDIT

Yea, now I'm sure... reverted back to 0.12.2 and it's producing the correct code.

var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
And more...

and also Jenkins build was successful too.
Thanks.

@insin
Copy link
Owner

insin commented Dec 13, 2016

Which type of project is this? Can you provide your nwb.config.js?

Notice that I removed global nwb and running the command from node_modules, is that the correct way of running if there is no global nwb installed?

If you use nwb in npm scripts, it works both ways - a local install creates node_modules/.bin/nwb and npm puts node_modules/.bin on the path when running scripts, alternatively you can call node_modules/.bin/nwb directly.

insin added a commit that referenced this issue Dec 13, 2016
@insin
Copy link
Owner

insin commented Dec 13, 2016

Does v0.13.6 fix this?

https://github.com/insin/nwb/releases/tag/v0.13.6

@vpezeshkian
Copy link
Author

Yoohoo, yes, this new release v0.13.6 seems to fix the issue. but fyi I'm pasting my nwb config, this project is a react component which I inject in other projects as dependency...

module.exports = {
  type: 'react-component',
  babel: {
    stage: 0,
    runtime: true
  },
  npm: {
    esModules: true,
    jsNext: true,
    global: '',
    externals: {
      'react': 'React'
    },
    umd: false
  },
  webpack: {
    aliases: {
      'webworkify': 'webworkify-nwb'
    },
    extra: {
      devtool: 'source-map'
    },
    html: {
      favicon: 'vendors/favicon.ico'
    }
  }
}

@insin
Copy link
Owner

insin commented Jan 12, 2017

Closing as fixed.

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

No branches or pull requests

2 participants