Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixing inline/externals not working with vue-cli 3 #148

Open
iNeoO opened this issue Jan 5, 2021 · 3 comments
Open

mixing inline/externals not working with vue-cli 3 #148

iNeoO opened this issue Jan 5, 2021 · 3 comments

Comments

@iNeoO
Copy link

iNeoO commented Jan 5, 2021

Hi,

I use vue-cli-3 with vue3 i use this config https://vue-svg-loader.js.org/faq.html#how-to-use-both-inline-and-external-svgs

is there anything else to do ?

import Logo from '@/assets/images/logo.svg?inline';
vue.runtime.esm.js?2b0e:619 [Vue warn]: Failed to resolve async component: function () {
            return __webpack_require__("./src/components/layout lazy recursive ^\\.\\/.*\\.vue$")("./".concat(_this.componentName, ".vue"));
          }
Reason: ReferenceError: h is not defined

externals are walking well. I tried default config and it worked well (but externals were crashing)

@iNeoO iNeoO changed the title inline not working inline not working with vue-cli 3 Jan 5, 2021
@iNeoO iNeoO changed the title inline not working with vue-cli 3 mixing inline/externals not working with vue-cli 3 Jan 6, 2021
@kingyue737
Copy link

I use vue-cli5 with vue2 and meet the same issue.
Here is my config:

{
  test: /\.svg$/,
  resourceQuery: /inline/,
  use: ['babel-loader', 'vue-svg-loader'],
  type: 'javascript/auto',
},

@kingyue737
Copy link

the docs is outdated. Replace babel-loader with vue-loader solved my issue.

@augustoyuudi
Copy link

I meet the same issue.
My import statement was missing the ?inline query string as described in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants