1

Using Laravel Mix by the way... and trying to use Vue Apollo, it says we need to add this to babel config:

        {
            test: /\.vue$/,
            use: [
                {
                    loader: 'vue-loader',
                    options: {
                        transpileOptions: {
                            transforms: {
                                dangerousTaggedTemplateString: true
                            }
                        }
                    }
                }
            ]
        },

but that is giving me Failed to mount component: template or render function not defined. error that I haven't been able to find a solution for, except for a thread somewhere in Google saying it's because I'm using vue-loader twice..

So, what I'm trying to do now that may fix this error is to apply that dangerousTaggedTemplateString setting to the existing webpack configuration for .vue files.

Anyone knows how to do that?

2
  • Are you using Vue-CLI or raw webpack? Are you using vue-cli-plugin-apollo? Where do you see that you're supposed to edit babel's config? This says vue.config.js, and then only if you're not using vue-cli-plugin-apollo Commented Oct 18, 2020 at 22:11
  • Not using vue-cli at all, and that link you point to says also that when you're not using vue-cli that you should edit raw webpack config. I'm editing webpack.mix.js, initially it looked like this: mix.js('resources/js/app.js', 'public/js').postCss('resources/css/app.css', 'public/css', []) Commented Oct 19, 2020 at 3:14

1 Answer 1

1

Try this (untested), leave the mix.js line you mentioned untouched. Then on a new line:

mix.options({
   vue: {
      transpileOptions: {
         transforms: {
            dangerousTaggedTemplateString: true
         }
      }
   }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.