browserify / factor-bundle

factor browser-pack bundles into common shared bundles
Other
402 stars 27 forks source link

Uncaught SyntaxError: Unexpected token ) #19

Closed andornaut closed 9 years ago

andornaut commented 10 years ago

I get this error in my common.js file: Uncaught SyntaxError: Unexpected token ); after using factor-bundle (and browser-unpack, browserify) as follows:

browserify src/app/a.js src/app/b.js src/app/c.js > build/bundle.js

browser-unpack < build/bundle.js | factor-bundle \
  src/app/a.js -o build/a.js \
  src/app/b.js -o build/b.js \
  src/app/c.js -o build/c.js \
  > build/common.js

The line in question is:

require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({35:[function(require,module,exports){
ule,exports){

ule,exports){ is repeated for several times in common.js.

andornaut commented 10 years ago

I can also reproduce with just two sources:

browserify src/app/a.js src/app/b.js > build/bundle.js
browser-unpack < build/bundle.js | factor-bundle \
  src/app/a.js -o build/a.js \
  src/app/b.js -o build/b.js \
  > build/common.js

I'm not experiencing any issues when using browserify without factor-bundle / browser-unpack.

terinjokes commented 10 years ago

Is this still an issue you see in the latest version of browserify and factor-bundle? I've never seen anything like it.