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.

ES6 import/linter error

See original GitHub issue

Hi,

I just tried to install your library via NPM

npm install tippy.js

and import it like this:

import Tippy from 'tippy.js';

But I get a lint error after importing the lib. I’m using browserify for the bundling. Lint error looks like this:

SyntaxError: Unexpected token (4:7) while parsing /node_modules/tippy.js/src/js/tippy.js while parsing file: /node_modules/tippy.js/src/js/tippy.js
    at DestroyableTransform.end [as _flush] (/node_modules/insert-module-globals/index.js:96:21)
    at DestroyableTransform.<anonymous> (/node_modules/readable-stream/lib/_stream_transform.js:115:49)
...

After changing the path in your package.json for “main” to “dist/tippy.js” it works. But I don’t think that’s the way you would like to have it.

Cheers Stefan

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jgujgucommented, Jul 11, 2021

For those using Tippy.js 6.x, similar to the advice above, just use this:

import tippy from 'tippy.js/dist/tippy-bundle.umd.min.js';
1reaction
StefanFesercommented, Apr 20, 2017

Thanks! Really appreciate your work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix “only available in ES6” linter errors? - Stack Overflow
I am trying to add a linter to my Express application and am getting several linter errors about ES6, i.e. 'export' is only...
Read more >
no-restricted-imports - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
eslint-plugin-import - npm
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import ...
Read more >
JavaScript modules - MDN Web Docs
If you don't, you'll get a strict MIME type checking error along the ... AMD module systems (as explained nicely in ES6 In...
Read more >
50 shades of ES6 modules - JavaScript in Plain English
you will never hear that it's ES6 modules. ... JS: 50 shade of ES6 Modules. ... The quiz code throws the following error:....
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