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.

Illegal import declaration

See original GitHub issue

Just updated to 0.17.1 and still getting the error: Illegal import declaration on the following line.

import request from 'superagent';

And here is my .eslintrc

{
  "ecmaFeatures": {
    "jsx": true
  },
  "env": {
    "browser": true,
    "node": true,
    "es6": true
  },
  "rules": {
    "strict": 0,
    "no-underscore-dangle": 0,
    "quotes": [
      2,
      "single"
    ]
  }
}

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:29 (17 by maintainers)

github_iconTop GitHub Comments

5reactions
orangewisecommented, Mar 31, 2016

this works for me:

"parserOptions": {
     "ecmaVersion": 6,
     "sourceType": "module"
}
4reactions
nzakascommented, Mar 19, 2015

You need to enable modules via ecmaFeatures: { modules: true }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parse Error: Line 1: Illegal import declaration
Save this question. Show activity on this post. I looked online and it appears that the import statement is not recognised unless I...
Read more >
Parse Error: Line 1: Illegal import declaration-babel.js
score:1. In the .eslintrc file, enable modules via ecmaFeatures: { modules: true }. See Illegal import declaration - Issue #2112 for additional information....
Read more >
eslint/eslint - Gitter
Parse Error: Line 1: Illegal import declaration. import React, { Component } from 'react' .eslintrc "parserOptions" : { "ecmaVersion" : 6, "sourceType" ...
Read more >
Illegal import declaration error
Just updated to 0.17.1 and still getting the error: Illegal import declaration on the following line. import request from 'superagent'; And ...
Read more >
Text
A BILL To combat illegal deforestation by prohibiting the importation of products ... ``(3) Treatment of products subject to multiple import declaration ......
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