DCsunset / vuetify-markdown-editor

A Vue.js Component for editing and previewing markdown using Vuetify.js
MIT License
63 stars 17 forks source link

Module not found: Error: Can't resolve 'vuetify-markdown-editor' #4

Closed Divepit closed 4 years ago

Divepit commented 4 years ago

My script tag looks as follows:

import { Editor } from 'vuetify-markdown-editor'
import 'vuetify-markdown-editor/dist/vuetify-markdown-editor.css'
export default {
  name: 'BlogpostCreator',
  components: { Editor },
  data () {
    return {
      title: '',
      content: ''
    }
  }
}

which renders:

Failed to compile.

./src/components/UI/BlogpostCreator.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/UI/BlogpostCreator.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve 'vuetify-markdown-editor' in '/Users/divebox/Documents/01 Programming/01 Websites/08 Portfolio Website/portfolio-website/src/components/UI'

Any suggestions what I did wrong?

DCsunset commented 4 years ago

Have you installed vuetify-markdown-editor in your project? (For example, use npm)

Divepit commented 4 years ago

Hey @DCsunset! Yes I have installed it using npm and also tried uninstalling and reinstalling it and I can see it in the node_modules directory. For some reason the compiler doesn't go look there...

Divepit commented 4 years ago

I managed to get rid of that error by importing the editor as follows:

import { Editor } from 'vuetify-markdown-editor/src/build-entry'

but then there is a new error which seems to be related to the way the stylesheet is imported into the MarkdownEditor component:

./node_modules/vuetify-markdown-editor/src/components/MarkdownEditor.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuetify-markdown-editor/src/components/MarkdownEditor.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '../style.css'
DCsunset commented 4 years ago

Oh...That was my fault. The build of v2.0.1 was messed up, and I have fixed it in v2.0.2. Check if the bug still exists.

Divepit commented 4 years ago

Awesome, works like a charm now! Thanks a million!