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

Name conflict with broccoli-es6-concatenator #1

Closed
taras opened this issue Apr 14, 2014 · 29 comments
Closed

Name conflict with broccoli-es6-concatenator #1

taras opened this issue Apr 14, 2014 · 29 comments

Comments

@taras
Copy link

taras commented Apr 14, 2014

var compileES6 = require('broccoli-es6-concatenator');
var transpileES6 = require('broccoli-es6-module-transpiler');

If you add both of these plugins to a Brocfile.js, you'll get Error: Invalid access to private name when trying to run build command.

@mmun
Copy link
Owner

mmun commented Apr 14, 2014

@eventualbuddha Do you know why this could be?

@taras
Copy link
Author

taras commented Apr 14, 2014

Here is a stacktrace with value that's causing the error

/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-concatenator/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:201
      throw Error('Invalid access to private name');
            ^
Error: Invalid access to private name
  at Error (<anonymous>:null:null)
  at assertNotName (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-concatenator/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:201:13)
  at defineProperty (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-concatenator/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:256:7)
  at new Name (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-module-transpiler/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:103:5)
  at /Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-module-transpiler/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:134:27
  at Object.<anonymous> (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-module-transpiler/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:539:3)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli-es6-module-transpiler/index.js:2:16)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/Users/quandl/Repositories/broccoli-sample-app/Brocfile.js:5:20)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.loadBrocfile (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/lib/builder.js:101:14)
  at getBuilder (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/lib/cli.js:65:23)
  at Command.program.command.description.action.actionPerformed (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/lib/cli.js:24:29)
  at Command.action (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/node_modules/commander/index.js:249:8)
  at Command.EventEmitter.emit (events.js:98:17)
  at Command.parseArgs (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/node_modules/commander/index.js:478:12)
  at Command.parse (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/node_modules/commander/index.js:370:21)
  at Object.broccoliCLI [as cli] (/Users/quandl/Repositories/broccoli-sample-app/node_modules/broccoli/lib/cli.js:57:11)
  at Object.<anonymous> (/usr/local/lib/node_modules/broccoli-cli/bin/broccoli:11:10)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at [object Object].Module.runMain [as _onTimeout] (module.js:497:10)
  at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)


Process finished with exit code 8

broccoli-es6-concatenator__es6-module-transpiler_js_-broccoli-sample-app-___repositories_broccoli-sample-app__and_index_js-broccoli-es6-module-transpiler-___repositories_broccoli-es6-module-transpiler

@mmun
Copy link
Owner

mmun commented Apr 14, 2014

The problem occurs with something as simple as:

$ node
> require('broccoli-es6-concatenator');
> require('broccoli-es6-module-transpiler');

@jayphelps
Copy link

I'm guessing this is related, if not the cause google/traceur-compiler#323

@mmun
Copy link
Owner

mmun commented Apr 14, 2014

@jayphelps Awesome, thanks!
@taras We need to wait for it be fixed upstream in thlorenz/es6ify and then square/es6-module-transpiler

@eventualbuddha
Copy link

I'm working on an alternate fix to the es6-module-transpiler. If es6ify is updated before I'm finished I'm happy to use the updated version.

@mansona
Copy link

mansona commented Jun 24, 2014

just come across this one with ember-cli, any update on the progress? anyone need some logs from me to help out with the issue?

@mmun
Copy link
Owner

mmun commented Jun 24, 2014

@mansona: @eventualbuddha reports that the upstream problem in es6ify will no longer affect the module transpiler once https://github.com/square/es6-module-transpiler/tree/rewrite-with-bindings gets merged.

@eventualbuddha
Copy link

It's now merged and released as v0.5.0. Going to require some reworking.

On Tuesday, June 24, 2014, Martin Muñoz [email protected] wrote:

@mansona https://github.com/mansona: @eventualbuddha
https://github.com/eventualbuddha reports that the upstream problem in
es6ify will no longer be an issue once
https://github.com/square/es6-module-transpiler/tree/rewrite-with-bindings
gets merged.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@mansona
Copy link

mansona commented Jun 25, 2014

Thanks @mmun and @eventualbuddha . Just to clarify this now that esnext/es6-module-transpiler#126 has been merged: broccoli-es6-module-transpiler will need a rework to use the the things from upstream?

Does anyone know how to get around this in the short term before all that happens? Last time this happened I made sure that I wasn't using 2 different versions in my npm deps but i've done that this time around and it doesn't seem to be helping.

@mmun
Copy link
Owner

mmun commented Jun 25, 2014

@mansona That's right. Unfortunately I don't see a clear upgrade path at the moment. I'm not sure if there's any solution for now :/

@eventualbuddha
Copy link

If someone wants to update the old version of the project to either (a) not use es6ify or (b) use a newer es6ify then I'd release a v0.4.x update. However, that may be more trouble than it's worth.

@simonexmachina
Copy link

So, can I just clarify the status of this issue please? If I understand correctly:

  • it's not possible to load more than one instance of this module in a VM
  • there's a (possible) solution in es6-module-transpiler 0.5.0
  • but there's no clear upgrade path at the moment

Do we have any way to work around this issue in the interim? Are there any other alternatives?

I'm trying to use this module in an ember-cli addon, and need to provide ES6 modules to the containing project. Not sure how I can do this without a pre-compile step without being able to use this module :(

@mmun
Copy link
Owner

mmun commented Jul 1, 2014

@aexmachina No work around at the moment. I believe the most direct solution is to upgrade the 0.4.x branch of es6-module-transpiler to use a newer version of es6ify, but I haven't looked into it myself.

As you can see from the source, this filter is very simple. An alternative solution is to rewrite this plugin to use the newer version of es6-module-transpiler. The caveats are that the transpiler is now N → 1, there's no AMD formatter yet and incremental builds aren't supported yet.

@simonexmachina
Copy link

Okay, that's a shame :( Thanks for the response. Just to clarify - my previous statements were correct right?

@eventualbuddha
Copy link

@aexmachina your previous statements sounded about right.

@simonexmachina
Copy link

Cool, thanks :)​

@joliss
Copy link

joliss commented Jul 4, 2014

Just to chime in re upgrade path: Do I understand correctly that we'll basically have to rewrite the broccoli-es6-concatenator completely, because the transpiler is now n:1 (i.e. reads multiple input files)? I just wanted to let everyone know that that's OK with me - we can definitely break all backwards compatibility and push out a new 0.x version. I don't have time to do this myself right now, but am happy to merge patches.

@alexBaizeau
Copy link
Contributor

Hey guys I ran into the same issue, so I wrote a clone of @joliss es6 concatenator which is compatible with es6-module-transpiler 0.6.0. You may want to give it a try. It's still a WIP and I need to work on caching mainly. https://github.com/alexBaizeau/broccoli-es6-concat

@simonexmachina
Copy link

Nice one! Where can I see it?

@alexBaizeau
Copy link
Contributor

Sorry I forgot the link in my first comment https://github.com/alexBaizeau/broccoli-es6-concat

@simonexmachina
Copy link

@joliss, any thoughts on @alexBaizeau's implementation. I think ideally we'd upgrade this module to use the new es6-module-transpiler, rather than having to use another module.

@mmun
Copy link
Owner

mmun commented Aug 11, 2014

@ericf has been working on implementing the new es6 module transpiler into this broccoli plugin (See the master branch). We're not quite ready to cut a release yet but you're welcome to try it out it. Note that the API has changed to accommodate the new transpiler's API. Please refer to the new README.

I've created a branch to support the earlier (v0.4.0) API of the transpiler. PRs are welcome but I won't be maintaining it and plan to deprecate it in the future.

@mmun mmun closed this as completed Aug 11, 2014
@simonexmachina
Copy link

Thanks @mmun. 👍

@cibernox
Copy link

cibernox commented Oct 7, 2014

I still have an issue with this.

$ ember build
version: 0.1.1
Building...
Invalid access to private name
Error: Invalid access to private name
    at Error (<anonymous>)
    at assertNotName (/Users/miguel/code/ember-cpm/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:201:13)
    at defineProperty (/Users/miguel/code/ember-cpm/node_modules/ember-cli/node_modules/broccoli-es6-concatenator/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:256:7)
    at new Name (/Users/miguel/code/ember-cpm/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:103:5)
    at /Users/miguel/code/ember-cpm/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:134:27
    at Object.<anonymous> (/Users/miguel/code/ember-cpm/node_modules/broccoli-dist-es6-module/node_modules/broccoli-es6-module-filter/node_modules/es6-module-transpiler/dist/es6-module-transpiler.js:539:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

This happens when I add var dist = require('broccoli-dist-es6-module') in an ember-cli project.

@mmun
Copy link
Owner

mmun commented Oct 7, 2014

It's a permanent problem with the old version of this plugin. :/

@cibernox
Copy link

cibernox commented Oct 7, 2014

There is a new version then?

@mmun
Copy link
Owner

mmun commented Oct 7, 2014

Yes, the module transpiler was rewritten from the ground up (version 0.5 and up), this plugin was rewritten to match (version 0.2 and up). More details: #1 (comment)

@cibernox
Copy link

cibernox commented Oct 7, 2014

Ok, I got it now. You mean esnext/es6-module-transpiler.

Indeed, broccoli-dist-es6-module this is package is based in 0.3.6. I'll see if its reasonably easy to update.

ericf added a commit that referenced this issue Nov 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants