megurock / vue-intersect-directive

VueJS directive to observe intersection of an element with viewport.
14 stars 4 forks source link

Error: Cannot find module '/node_modules/vue-intersect-directive/dist/vue-intersect-directive.js'. #5

Open phlegx opened 3 years ago

phlegx commented 3 years ago

Installing the package with:

import Vue from 'vue'
import VueIntersect from 'vue-intersect-directive'

Vue.use(VueIntersect)

Outputs this error:

Error: Cannot find module '/node_modules/vue-intersect-directive/dist/vue-intersect-directive.js'. Please verify that the package.js
on has a valid "main" entry

The file dist/vue-intersect-directive.js does not exists.

Workaround

import Vue from 'vue'
import VueIntersect from 'vue-intersect-directive/dist/vue-intersect-directive.esm.js'

Vue.use(VueIntersect)
megurock commented 3 years ago

@phlegx Well, I'm not sure what causes this. Everything is fine under my enviroment. As the error outputs above mentions, would you check the main entry point in your package.json? I even don't need the package.json to find the reference to the module with my VSCode, though.