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

Error building with gulp + browserify + babel #115

Closed
exos opened this issue Jun 14, 2016 · 4 comments
Closed

Error building with gulp + browserify + babel #115

exos opened this issue Jun 14, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@exos
Copy link

exos commented Jun 14, 2016

I have this error when i tried to browserify my app:

ReferenceError: [BABEL] /home/exos/projectv/node_modules/localforage/dist/localforage.js: Using removed Babel 5 option: /home/exos/projectv/node_modules/localforage/.babelrc.loose - Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option.
    at Logger.error (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/logger.js:41:11)
    at OptionManager.mergeOptions (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:288:20)
    at OptionManager.addConfig (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:232:10)
    at OptionManager.findConfigs (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:436:16)
    at OptionManager.init (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/options/option-manager.js:484:12)
    at File.initOptions (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/index.js:223:65)
    at new File (/home/exos/projectv/node_modules/babel-core/lib/transformation/file/index.js:140:24)
    at Pipeline.transform (/home/exos/projectv/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at Babelify._flush (/home/exos/projectv/node_modules/babelify/index.js:27:24)
    at Babelify.<anonymous> (_stream_transform.js:118:12)

I install all babel plugins there are on the localForage package.json:

My package.json section:

  "devDependencies": {
    "angular-localforage": "^1.2.5",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-system-import-transformer": "^2.0.0",
    "babel-plugin-transform-es2015-modules-umd": "^6.8.0",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-es2015-loose": "^7.0.0",
    "babelify": "^7.3.0",
    "brfs-htmlmin": "^2.0.0",
    "gulp": "^3.9.1",
    "gulp-browserify": "^0.5.1",
    "gulp-jshint": "^2.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.3.1",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify": "^1.5.3",
    "ionic-material": "https://github.com/zachfitz/Ionic-Material.git#v0.4.2",
    "jshint": "^2.9.2",
    "jshint-stylish": "^2.2.0",
    "napa": "^2.3.0",
    "yargs": "^4.7.1"
 }

My gulp task:

gulp.task('build-lib', function () {

    var options = {
        insertGlobals : true,
        debug : argv.debug,
        shim: {
            angular: {
                path: "./node_modules/ionic/release/js/ionic.bundle.min.js",
                exports: "angular"
            }
        },
        extensions: [
            'es6'
        ],
        transform: [
            'babelify',
            'brfs-htmlmin'
        ]
    };

    return gulp.src(paths.lib)
        .pipe(sourcemaps.init())
        .pipe(browserify(options))
        .pipe(sourcemaps.write())
        .pipe(rename('app.js'))
        //.pipe(uglify())
        .pipe(rename('app.js'))
        .pipe(gulp.dest('www/js'));
});

my .babelrc

{
    "presets": ["es2015-loose"],
    "plugins": [
        "add-module-exports"
    ]
}

And I copied the file .babelrc-umd from the project. But I get the same error.

Some versions:

node: v5.11.1
npm: 3.8.6
@scotttrinh
Copy link
Owner

I'm not super familiar with Babel: what do you make of the first line of your error message:

ReferenceError: [BABEL] /home/exos/projectv/node_modules/localforage/dist/localforage.js: Using removed Babel 5 option: /home/exos/projectv/node_modules/localforage/.babelrc.loose - Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option.

?

Looks like an issue with localForage? I don't see any reference to .babelrc.loose in their code, but I'll dig a bit.

@exos
Copy link
Author

exos commented Jun 14, 2016

Yes, i'ts, I re-post it in localForage/localForage#578

@exos exos closed this as completed Jun 14, 2016
@scotttrinh
Copy link
Owner

@exos I see that we just need to package a release that bumps the localForage to 1.4. I just took over the maintenance of this package, so this weekend, I'm going to put together a roadmap and keeping up with the upstream library is going to be high priority for me. I'm going to reopen this issue until the new version is out.

@scotttrinh scotttrinh reopened this Jun 15, 2016
@scotttrinh scotttrinh self-assigned this Jun 15, 2016
@exos
Copy link
Author

exos commented Jun 15, 2016

Yes, I continued this issue on the localForage repo's (this is the issue) and I got to a solution instaling first the last version (1.4) of localForage, or installing this package but using the master branch instead of the published release.

@scotttrinh scotttrinh added the bug label Jun 15, 2016
@scotttrinh scotttrinh added this to the 1.3.0 milestone Jun 19, 2016
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