question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't alias vue for compiler included build

See original GitHub issue

Vue doesn’t seem to alias correctly so I can use the compiler included build.

To repro I have used an external library vuejs-datepicker which must have template: code and is throwing the following

image

I have tried a bunch of variations in the alias config field, including those mentioned here on the vue js docs.

https://vuejs.org/v2/guide/installation.html#Explanation-of-Different-Builds

image

if i alias the field with something like ‘vue-alias’ then import vue from 'vue-alias' I get pass the error but I am in even more pain as other libraries that use vue don’t know where to look

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SimulatedGREGcommented, Apr 9, 2017

Updated externals configuration to whitelist specific modules, in this case vue. To anybody coming to this later, here’s a fix…

webpack.renderer.config.js

/* ... */
externals: Object.keys(pkg.dependencies || {}).filter(d => !['vue'].includes(d)),
/* ... */
alias: {
  'vue$': 'vue/dist/vue.esm.js',
  'components': path.join(__dirname, 'app/src/renderer/components'),
  'renderer': path.join(__dirname, 'app/src/renderer')
}
/* ... */

This fix has been applied in the dev branch. See #171 for more details.

1reaction
deboyblogcommented, Apr 3, 2017

Today I also encountered the same problem checkout this setting (webpack.renderer.config.js) Only need to comment out this line

  externals: Object.keys(pkg.dependencies || {}),

change alieas config as

    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      'components': path.join(__dirname, 'app/src/renderer/components'),
      'renderer': path.join(__dirname, 'app/src/renderer')
    }

rerun

npm run dev
Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue cli 3 project alias src to @ or ~/ not working
For Vue CLI you need to create a file in the root folder of project - jsconfig.json { "include": ["./src/**/*"], "compilerOptions": ...
Read more >
Vue use the compiler-included build - Get Help
I'm getting a Vue warn that prevents my page from loading: ps: I'm not using build, I'm using yarn serve [Vue warn]: You...
Read more >
vue/compat
In the build setup, alias vue to @vue/compat and enable compat mode via Vue compiler options. Example Configs. vue-cli.
Read more >
FAQ | Vetur - GitHub Pages
If you don't have any package.json in your project, Vetur can't know the Vue version and component data from other libs. Vetur assumes...
Read more >
jsconfig.json Reference - Visual Studio Code
For IntelliSense to work with webpack aliases, you need to specify the paths keys with a glob pattern. For example, for alias 'ClientApp':...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found