-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
[Webpack 3?] Duplicate declaration error #611
Comments
Actually, there are just two places where /* 36 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = count;
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
/**
* @module utils/count
*/
/**
* Returns the number of items return by the iterator.
*
* count( [ 1, 2, 3, 4, 5 ] ); // 5;
*
* @param {Iterable.<*>} iterator Any iterator.
* @returns {Number} Number of items returned by that iterator.
*/
function count( iterator ) {
let count = 0;
for ( let _ of iterator ) { // jshint ignore:line
count++;
}
return count;
}
/***/ }) And: insertChildren( index, nodes ) {
this._fireChange( 'children', this );
let count = 0;
nodes = normalize( nodes );
for ( let node of nodes ) {
node.parent = this;
this._children.splice( index, 0, node );
index++;
count++;
}
return count;
} The first is that imported |
Thanks for the detailed writeup. Seems to a bug in DCE. |
Duplicate of #226 . That got fixed. But looks like it has reappeared. minimal repro: function foo() {
function count(it) {
let count = 1;
for(;it();) {
count++;
}
return count;
}
return count;
} |
* Detect duplicate declaration during one-use replacement Fix #611 * FnDecls always have id
Is a build with that fix already published on npm? I just updated and still get the error. export default function x () {
let x
} throws for me a duplicate declaration error |
I've been trying to isolate this error, but I think that it has something to do with Webpack 3 and I can't pull anything of value from Babili and Webpack.
However, you can reproduce this issue by:
This is the output I get:
This is the Webpack config: https://github.com/ckeditor/ckeditor5-build-classic/blob/babili-webpack-error/webpack.config.js
And the crucial file is this one: https://github.com/ckeditor/ckeditor5-typing/blob/958eeb26c6d862de3cdfbf53efd0a554e3c8e13e/src/typing.js
It imports:
Which both depends on:
Both of these modules import
count
function and I think that this is that duplicatedcount
identifier.If I disable Babili plugin in
webpack.config.js
everything works fine. I also checked that builds done without Babili run correctly so most likely the issue is not on Webpack's side.Output without Babili:
I've checked the unminified output but I can't find anything there which would suspiscious.
I'm using webpack 3.0.0 and babili-webpack-plugin 0.1.2.
The text was updated successfully, but these errors were encountered: