Skip to content

vue-loader is not pre-compiling my SFC templates #1383

@jasonmng

Description

@jasonmng

Version

15.3.0

Reproduction link

https://codesandbox.io/s/wo2rl5622l

Steps to reproduce

Using webpack build a simple SFC component using vue-loader, then try to view that component in the browser. Do not include:

  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js'
    }
  },

in your webpack config.

What is expected?

I see the the text "Hello World"

What is actually happening?

I get a browser console error saying: you are using the runtime-only build of Vue where the template compiler is not available.


I’m not sure if I am understanding this correctly but in the docs it says that if you are using vue-loader, it’ll pre-compile SFC templates for you. I’m wondering why then I am getting this error you are using the runtime-only build of Vue where the template compiler is not available. in the browser console. And why I need to add alias: {’vue$': 'vue/dist/vue.esm.js'} to fix the issue.

About the "Link to minimal reproduction": I tried creating a custom webpack.config file but it doesn't seem to work or I don't know how to get it to work. Anyways, this is the basic setup I have that will show the issue I am having.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions