Waypoint npm - Error: Can't resolve 'waypoint Waypoint npm - Error: Can't resolve 'waypoint vue.js vue.js

Waypoint npm - Error: Can't resolve 'waypoint


Waypoints comes bundled in several flavours, even via NPM, but I couldn't work out if there's a default implementation or not. So that's why your typical import Waypoint from 'waypoints' directive doesn't work.

I resolved this for my "vanilla ES6 + Webpack" setup as follows:

import 'waypoints/lib/noframework.waypoints.min.js';const waypoint = new Waypoint({  element: document.getElementById('myScrollTarget'),  handler: () => {}});


Basically @markedup is right, waypoints comes with various flavours, after installing waypoints if you look into /waypoints/lib/ folder you will see zepto|jquery|noframework.waypoints.js .

In this case you would require to import it as full path i.e.

import 'waypoints/lib/noframework.waypoints.min.js';

or

window.waypoint = require('waypoints/lib/noframework.waypoints');