how to fix unexpected token parsing error?

The arrow works for me all time but i get an error now Parsing error: Unexpected token => I tried checking the syntax and bracket and yeah, I dint miss any brackets. Code : const functions = …

Natively import ES module dependencies from npm without bundling/transpiling first-party source

Background I’m trying to create a “buildless” JavaScript app, one where I don’t need a watch task running to transpile JSX, re-bundle code, etc every time I save any source file. It works …

ES module imports – can it always be done? A failed example trying to import socket.io-client

I’m trying to use a “build-less” process so I’m using a plain module script in an html file (following the Preact docs): import { html, …

How to make summary module that re-exports all the exports of sub-modules for ESM modules?

How do you re-export the exports from multiple files in an ESM module without listing each individual export separately? I have a CommonJS module directory that consists of a number of files that I …

Webpack ES6 modules multiple class app organization

I’m building an app with webpack for the first time and i’m trying to wrap my head around organizing class files. I’m having trouble getting the code to work. I’m still new to ES6 and such, so my code …

ES6 modules – imported constants undefined if not in React component

The only similar question I have found is this one but I can’t see how would I have caused a circular dependancy in this case: I have a file exporting constants like so: (choices array version is for …

Using ES Modules with babel-standalone

Quoting babel docs https://babeljs.io/docs/en/babel-standalone#usage : “If you want to use your browser’s native support for ES Modules, you’d normally need to set a type=”module” …

How would I import a custom web component asynchronously?

I have made my custom input element (modern text input for forms) into a web component. The .js file that I made to implement it has three parts. The HTML Template: const textInputTemplate = …

How to dynamically execute/eval JavaScript code that contains an ES6 module / requires some dependencies?

I want my users to be able to use JavaScript as a scripting language inside my JavaScript application. In order to do so, I need to dynamically execute the source code. There seem to be two main …

Does ES6 import/export need “.js” extension?

I installed chrome beta – Version 60.0.3112.24 (Official Build) beta (64-bit) In chrome://flags/ I enabled ‘Experimental Web Platform features’ (see https://jakearchibald.com/2017/es-modules-in-…