Rollup: Conflicting namespaces (lots of them)


#1
rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js

            re-exports 'TextAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'BoundTextAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'AttrAst' from both

            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be

            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'BoundElementPropertyAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'BoundEventAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js

            re-exports 'ReferenceAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'VariableAst' from both

            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'ElementAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be

            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'EmbeddedTemplateAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'BoundDirectivePropertyAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'DirectiveAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'ProviderAst' from both

            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'ProviderAstType' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js

            re-exports 'NgContentAst' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'PropertyBindingType' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be
            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.
[23:14:08]  rollup: Conflicting namespaces: /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/index.js
            re-exports 'templateVisitAll' from both
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js (will be

            ignored) and
            /Users/tyrion/devel/saveup-front/node_modules/@angular/compiler/src/template_parser/template_ast.js.

My package.json:

{
  "name": "awesome",
  "description": "An Awesome Project",
  "private": true,
  "engines": {
    "node": "4.3.0",
    "npm": "3.8.6"
  },
  "repository": {
    "type": "git",
    "url": "git+blabla.git"
  },
  "author": "Me",
  "homepage": "https://bitbucket.org/blabla/blalba-front",
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "@ngrx/core": "1.2.0",
    "@ngrx/store": "2.2.1",
    "angular-core": "0.0.5",
    "angular2-jwt": "0.1.23",
    "browserify": "13.1.0",
    "es6-shim": "0.35.0",
    "intern": "3.2.3",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "jStat": "1.5.2",
    "minilog": "3.0.1",
    "ng2-translate": "4.0.0",
    "reflect-metadata": "0.1.3",
    "require": "2.4.20",
    "rxjs": "5.0.0-beta.12",
    "tsify": "2.0.1",
    "tslint": "3.10.2",
    "typescript": "2.0.6",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.39",
    "@types/core-js": "0.9.34",
    "@types/debug": "0.0.29",
    "@types/es6-shim": "0.31.32",
    "@types/jasmine": "2.5.35",
    "@types/jasmine-expect": "2.0.28",
    "@types/js-base64": "2.1.4",
    "@types/karma-jasmine": "0.0.28",
    "@types/lodash": "4.14.37",
    "del": "2.2.0",
    "gulp": "3.9.1",
    "gulp-jasmine": "2.4.1",
    "gulp-karma": "0.0.5",
    "gulp-ll": "1.0.3",
    "gulp-watch": "4.3.5",
    "intern": "3.2.3",
    "isparta": "4.0.0",
    "jasmine": "2.5.2",
    "jasmine-core": "2.5.2",
    "js-base64": "2.1.9",
    "karma": "v0.13.19",
    "karma-chrome-launcher": "2.0.0",
    "karma-jasmine": "1.0.2",
    "karma-typescript-preprocessor": "0.2.1",
    "karma-verbose-reporter": "0.0.3",
    "ngrx-store-freeze": "0.1.0",
    "remap-istanbul": "0.6.4",
    "run-sequence": "1.1.5",
    "tslint-loader": "2.1.4"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "cordova-plugin-inappbrowser",
    "cordova-plugin-pin-dialog",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "scripts": {
    "build": "ionic-app-scripts build",
    "watch": "ionic-app-scripts watch",
    "clean": "ionic-app-scripts clean",
    "serve:before": "watch",
    "emulate:before": "build",
    "deploy:before": "build",
    "build:before": "build clean",
    "run:before": "build"
  },
  "config": {
    "ionic_rollup": "./rollup.config.js"
  }
}

My Rollup.config.js:

var nodeResolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var globals = require('rollup-plugin-node-globals');
var builtins = require('rollup-plugin-node-builtins');
var json = require('rollup-plugin-json');


// https://github.com/rollup/rollup/wiki/JavaScript-API

var rollupConfig = {
    /**
     * entry: The bundle's starting point. This file will
     * be included, along with the minimum necessary code
     * from its dependencies
     */
    entry: '{{SRC}}/app/main.dev.ts',

    /**
     * sourceMap: If true, a separate sourcemap file will
     * be created.
     */
    sourceMap: true,

    /**
     * format: The format of the generated bundle
     */
    format: 'iife',

    /**
     * dest: the output filename for the bundle in the buildDir
     */
    dest: 'main.js',

    /**
     * plugins: Array of plugin objects, or a single plugin object.
     * See https://github.com/rollup/rollup/wiki/Plugins for more info.
     */
    plugins: [
        builtins(),
        commonjs({
            namedExports: {
                // js-base64
                'node_modules/js-base64/base64.js': ['Base64']
            }
        }),
        nodeResolve({
            module: true,
            jsnext: true,
            main: true,
            browser: true,
            extensions: ['.js']
        }),
        globals(),
        json()
    ]

};


if (process.env.IONIC_ENV == 'prod') {
    // production mode
    rollupConfig.entry = '{{TMP}}/app/main.prod.ts';
    rollupConfig.sourceMap = false;
}


module.exports = rollupConfig;

#2

Having this same problem as well. It seems to something with the rollup.config, cause if I remove it, then it builds without errors.


#3

We need custom roll up config for many workaround and fixes of AoT agnostic packages, e.g. base64


#4

Yea same for me, I’m using it to get pouchdb working


#5

So whats the solution here?

We can’t delete rollup config, but we can’t upgrade to RC2. Deadlock. And no word about it in changelog.