Answer the question
In order to leave comments, you need to log in
Another error in node js export?
export { default as add } from './add.js';
^^^^^^
SyntaxError: Unexpected token export
import { get, isNil } from 'lodash-es';
{
"compileOnSave": false,
"compilerOptions": {
"importHelpers": true,
"outDir": "./dist/out-tsc",
"baseUrl": "./",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"allowJs": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2016",
"dom",
"esnext.asynciterable",
"esnext.array",
"es2017.object"
],
"module": "commonjs"
}
}
Answer the question
In order to leave comments, you need to log in
This is a re-export (import+export in one statement).
You either need a more recent node or use the lodash module instead of lodash-es
This design should have import
.
And export
spelled differently
const greeting = (name) => console.log(`Hello, ${name}`);
export default greeting;
/* или */
export { greeting };
And import'ы
it will be different for both cases. For the first and for the secondimport greeting from './file.js';
import { greeting } from './file.js';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question