No matter which file I take, it does not work. I always get the error message.
I downloaded version 1.14.3 via yarn.
All tried but it does not work:
"./node_modules/popper.js/dist/esm/popper.min.js",
"./node_modules/popper.js/dist/umd/popper.min.js",
"./node_modules/popper.js/dist/popper.min.js",
This causes the error:
export default Le;
Can the error be with my gulp task?
// babel js task - transpile our Javascript into the build directory
gulp.task('js-babel', function() {
$.fancyLog("-> Transpiling Javascript via Browserify & Babelify...");
$.glob(''+pkg.globs.babelJs+'', function(err, files) {
if (err) {
$.util.log($.util.colors.red('Glob error:'),err);
}
var tasks = files.map(function(entry) {
$.fancyLog(entry);
return $.browserify(entry)
.transform('babelify')
.bundle()
.pipe($.vinylSourceStream($.path.resolve(entry), $.path.resolve(pkg.paths.src.js)))
.on('error', function(e) {
$.util.log($.util.colors.red('Browserify compile error:'),e.message);
})
.pipe(gulp.dest(pkg.paths.build.js));
});
});
});
// inline js task - minimize the inline Javascript into _inlinejs in the templates path
gulp.task("js-inline", () => {
$.fancyLog("-> Copying inline js");
return gulp.src(pkg.globs.inlineJs)
.pipe($.plumber({errorHandler: onError}))
.pipe($.if(["*.js", "!*.min.js"],
$.newer({dest: pkg.paths.templates + "_inlinejs", ext: ".min.js"}),
$.newer({dest: pkg.paths.templates + "_inlinejs"})
))
.pipe($.if(["*.js", "!*.min.js"],
$.uglify()
))
.pipe($.if(["*.js", "!*.min.js"],
$.rename({suffix: ".min"})
))
.pipe($.size({gzip: true, showFiles: true}))
.pipe(gulp.dest(pkg.paths.templates + "_inlinejs"))
.pipe($.filter("**/*.js"))
.pipe($.browserSync.stream());
});
// js task - minimize any distribution Javascript into the public js folder, and add our banner to it
gulp.task("js", ["js-inline", "js-babel"], () => {
$.fancyLog("-> Building js");
return gulp.src(pkg.globs.distJs)
.pipe($.plumber({errorHandler: onError}))
.pipe($.if(["*.js", "!*.min.js"],
$.newer({dest: pkg.paths.dist.js, ext: ".min.js"}),
$.newer({dest: pkg.paths.dist.js})
))
.pipe($.if(["*.js", "!*.min.js"],
$.uglify()
))
.pipe($.if(["*.js", "!*.min.js"],
$.rename({suffix: ".min"})
))
.pipe($.header(banner, {pkg: pkg}))
.pipe($.size({gzip: true, showFiles: true}))
.pipe(gulp.dest(pkg.paths.dist.js))
.pipe($.filter("**/*.js"))
.pipe($.browserSync.stream());
});
export default Le; is not part of Popper.js, it must be some of your code.
Hm, that's not right. Look here: https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/esm/popper.min.js
Oh ok that's the minified ES build, you should use it only if your build tool supports ES modules. Otherwise you should use UMD.
Thank you! It work's now. My build tool was wrong.
Most helpful comment
Oh ok that's the minified ES build, you should use it only if your build tool supports ES modules. Otherwise you should use UMD.