F
F
frontendzzz2018-05-11 20:34:05
JavaScript
frontendzzz, 2018-05-11 20:34:05

ES6 export/import not working in browser when building via Webpack?

Greetings. I can’t figure it out ((((Why export / import in ES6 does not work in Google. I collect Webpack modules, everything is fine in the main.js file, but when I run it in the browser it gives an error ... at the bottom there is a screen with an error.
Code :

function sum (a, b, c) {
  let sum = a + b + c;
  console.log(sum);
};
export default sum;

import sum from './some.js';
sum(3, 5, 2);

5af5d302746ac370050652.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question