sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

cannot find module 'sticky-kit'

Open dmitrylebedev opened this issue 9 years ago • 7 comments
trafficstars

Hi! Do you plan support for ES6 modules?

dmitrylebedev avatar Oct 28 '16 07:10 dmitrylebedev

I don't see a reason not to. I'm considering a rewrite from coffeescript -> es6 at some point.

leafo avatar Oct 28 '16 18:10 leafo

@leafo The error "cannot find module" happens because the package.json is incorrect. The file is located at dist/sticky_kit.js but the package.json "main" is set to sticky_kit.js. If you fix this, it'll at least be loosely compatible with webpack/es6.

scotthovestadt avatar Nov 20 '16 05:11 scotthovestadt

Note that I see the correct value for main in the GitHub repo but not in the package.json fetched from NPM.

scotthovestadt avatar Nov 20 '16 05:11 scotthovestadt

Until the latest package.json is pushed to npm, you can use it as

import 'sticky-kit/dist/sticky-kit.js';

or

require('sticky-kit/dist/sticky-kit.js');

fregante avatar Nov 27 '16 12:11 fregante

Do not publish to npm? @leafo

km-tr avatar Jan 12 '17 10:01 km-tr

I was having a similar issue but via JSPM - import 'sticky-kit/dist/sticky-kit.js'; does solve my build process not finding the js file, even with the package.json pointing to sticky-kit.js (the correct file) When importing I get an empty object only while still running the build process (grunt) - If I stop the process and restart it all is well.

Webbist-dev avatar Jan 04 '18 17:01 Webbist-dev

@leafo any chances to update package.json in NPM repository?

vega231 avatar May 29 '19 12:05 vega231