question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

export default from './file' throws Parsing error: Unexpected token './file'

See original GitHub issue

What version of ESLint are you using? ^2.9.0

What parser (default, Babel-ESLint, etc.) are you using? babel-eslint

Please show your full configuration:

{
  "parser"  : "babel-eslint",
  "extends" : [
    "standard",
    "standard-react"
  ],
  "env"     : {
    "browser" : true
  },
  "globals" : {
    "__DEV__"      : false,
    "__PROD__"     : false,
    "__DEBUG__"    : false,
    "__COVERAGE__" : false,
    "__BASENAME__" : false
  },
  "rules": {
    "semi" : [2, "never"],
    "max-len": [2, 120, 2]
  }
}

What did you do? Please include the actual source code causing the issue.

export default from './file'

What did you expect to happen? No errors

What actually happened? Please include the actual, raw output from ESLint.

1:21  error  Parsing error: Unexpected token './file'

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
michaelficarracommented, May 15, 2016

It is a syntax error. You need curlies:

export {default} from './file'
1reaction
michaelficarracommented, May 16, 2016

No, the export-from syntax I listed is valid ES2015 (meaning espree should parse it). The originally posted syntax is not, nor is the syntax in @diegohaz’s follow-up comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

es6 export throws Parsing error: Unexpected token
1 Answer 1 · You get an error because you have invalid export syntax. Try export class App instead. · When you write...
Read more >
SyntaxError: Unexpected token 'export' in JavaScript
To solve the "Uncaught SyntaxError Unexpected token 'export'" error, set the type property to module in your package.json file. Files ending with a...
Read more >
TypeScript Jest: Unexpected Token Export - Reddit
I'm trying to run unit tests for a TypeScript project which uses another TypeScript project I've created as a dependency.
Read more >
Developers - export default from './file' throws Parsing error ...
export default from './file ' throws Parsing error: Unexpected token './file'. ESLint. 15 May 2016 Posted by diegohaz. What version of ESLint are...
Read more >
Unexpected Token Export: A Comprehensive Guide
To resolve the uncaught syntaxError unexpected token 'export' error, the programmer has to change the type property to “module” in their package.json file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found