Linked Questions

7 votes
2 answers
16k views

Type Error - Is Not a Constructor [duplicate]

Wanted to instantiate a module within ES6 javascript and transpile to ES5. I am setting up a new class in my project which is es6 / webpack. I have 2 files: track.js which has the following -- ...
Yasir's user avatar
  • 909
1169 votes
12 answers
360k views

When should I use curly braces for ES6 import?

It seems to be obvious, but I found myself a bit confused about when to use curly braces for importing a single module in ES6. For example, in the React-Native project I am working on, I have the ...
TonyW's user avatar
  • 18.9k
353 votes
6 answers
270k views

`export const` vs. `export default` in ES6

I am trying to determine if there are any big differences between these two, other than being able to import with export default by just doing: import myItem from 'myItem'; And using export const I ...
ajmajmajma's user avatar
  • 14.3k
36 votes
4 answers
30k views

ES6 module syntax: is it possible to `export * as Name from ...`?

See question title. I found a great reference for the forms of export available, but I have not seen what I'm looking for. Is it possible to do something like the following? // file: constants.js ...
vergenzt's user avatar
  • 10.5k
3 votes
2 answers
5k views

ES6 export the result of a function

I am trying to export the result of a function in ES6. The function is unimportant - the following examples work for: const func = input => input This works: const a = 'foo' const b = 'bar' ...
Henry Heath's user avatar
  • 1,082
1 vote
1 answer
3k views

webpack js file scope - import functions file

I am learning to use webpack for first time. I am really stuck with something that was never a problem with gulp, that is the way it scopes different files. I have a file that contains multiple ...
TheRealPapa's user avatar
  • 4,551
1 vote
1 answer
2k views

Aurelia module global configuration

I have installed toastr in my Aurelia app. I am able to import and use it in different views, but I can't figure out how to set/modify its global options. Ideas?
Kostadin Mandulov's user avatar
0 votes
3 answers
2k views

library not recognised in reactjs

clicke here to see pondjs folder inside node-modulesI've installed pondjs(https://www.npmjs.com/package/pondjs) using npm install pondjs --save in my react application. It's also present in package....
Ashag's user avatar
  • 877
0 votes
1 answer
176 views

NavigatorIOS Error - React Native

React Native When I try to go another page i keep getting this error goToMenu(){ this.props.navigator.push({ component: Menu, title: 'Main Menu', passProps: {navigator: this.props.navigator}...
Chris Manfredi's user avatar
0 votes
1 answer
111 views

Using ES6 modules in JavaScript to export simple variables

I am defining pageId = 3 in JavaScript in one file and socket = io() in another file and I want to use these variables in other files. I guess I should use modules in ES6, but I am not sure how to do ...
mortensen's user avatar
  • 1,237