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.

Uncaught SyntaxError: Unexpected token import

See original GitHub issue

After i edit the src/App.js with the example in the Getting Started, i get this error : Uncaught SyntaxError: Unexpected token import

It originates from the line import _AdminBuilder from './AdminBuilder';

Seen here :

/* 268 */
/*!*******************************************!*\
  !*** ./~/api-platform-admin/lib/index.js ***!
  \*******************************************/
/***/ function(module, exports) {

	import _AdminBuilder from './AdminBuilder';
	export { _AdminBuilder as AdminBuilder };
	import _Create from './Create';
	export { _Create as Create };
	import _Edit from './Edit';
	export { _Edit as Edit };
	import _fieldFactory from './fieldFactory';
	export { _fieldFactory as fieldFactory };
	import _inputFactory from './inputFactory';
	export { _inputFactory as inputFactory };
	import _List from './List';
	export { _List as List };
	import _Show from './Show';
	export { _Show as Show };

	export * from './hydra';

I also get several warnings from the yarn add api-platform-admin command :

 yarn add api-platform-admin
yarn add v0.27.5
[1/4] Resolving packages...
warning api-platform-admin > lodash.isarray@4.0.0: This package is deprecated. Use Array.isArray.
[2/4] Fetching packages...
warning fsevents@1.0.17: The platform "linux" is incompatible with this module.
info "fsevents@1.0.17" is an optional dependency and failed compatibility check. Excluding it from installation.
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 66 new dependencies.

Could it come from these ?

Regards,

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Simperfitcommented, Sep 1, 2017

I don’t think I have the rights.

0reactions
alanpoulaincommented, Jan 13, 2020

Should be fixed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught SyntaxError: Unexpected token import - Stack ...
Then I changed my main script tag to import it as a module and it was working, but I still received the error....
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 >
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 >
JavaScript ES6 - How to fix Unexpected token import - YouTube
This video is a short explanation on how to fix the syntax error : " Unexpected Token Import "Hint: type="module"
Read more >
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
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