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.

Unexpected token import

See original GitHub issue

Hi,

When I try to use your library with SystemJS by importing it like so:

import MaterialDatePicker from 'material-datetime-picker';

or

import MaterialDateTimePicker from 'material-datetime-picker';

I got this error:

Error: (SystemJS) SyntaxError: Unexpected token import

Do you have any idea about where this could come from? Because after looking at the code, I think the README is pointing to the wrong component.

Thanks for your time,

Raphaël

Environment

Browser

  • Chrome 51 (Windows, Mac)

Library

  • v1.0.1 (via jspm => npm)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Jivingscommented, Sep 20, 2016

@orwldn can you share your .babelrc? I think by default babel will not compile anything in node_modules.

0reactions
joewscommented, Jan 28, 2017

Fixed in 2.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js - SyntaxError: Unexpected token import - Stack Overflow
Use transpiler like Babel to use import in Nodejs as it is not natively supported in nodejs.There is best alternative of import is...
Read more >
Nodejs Uncaught SyntaxError: Unexpected token import
An unexpected token import occurs when an error message appears in the console while running a web application.
Read more >
SyntaxError: Unexpected token import in Node.js | bobbyhadz
The "SyntaxError: Unexpected token import" occurs when we use the ES6 import syntax in a version of Node that doesn't support it. To...
Read more >
Unexpected token import Node.js - Reactgo
In this tutorial, we are going to learn about how to resolve the unexpected token import error in Node.js.
Read more >
Error Unexpected token import in nodejs | Edureka Community
SyntaxError: Unexpected token import at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:387:25) at Object.Module.
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