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.

Not working when building as library

See original GitHub issue

I have a setup with the default Vue.js CLI 3 installed and this plugin, no modifications. I would like to generate a library using this script from the package.json file:

"build-bundle": "vue-cli-service build --target lib --name CreationConfigurator"

When I load the generated demo.html file in my browser is says: vue.js:597 [Vue warn]: Error in render: "TypeError: _vm.$t is not a function"

Is it possible to make this plugin compatible with the build target for libraries? Or tell me how to fix this issue!

Thanks.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
gangsthubcommented, Jul 30, 2020

I think I found the reason: by default in --target lib mode, the entry point for the library is .src/App.vue. But vueI18n is referenced in the main.js file. So you need to specify the js file as the entry point. For example:

vue-cli-service build --target lib --name my-library-name ./src/main.js

No need to edit the vue.config.js file.

0reactions
gangsthubcommented, Sep 29, 2020

Sorry, @TorusHelm, I didn’t understand the question. Check the docs on what’s the difference between different targets 😉

https://cli.vuejs.org/guide/build-targets.html#library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get errors when I link to a library, but not when I build ...
I'm working on an external module for a c++ library (ITK), which I'm building with cmake and make (I'm on an Ubuntu VM)....
Read more >
ng build --watch does not work when building a library #11617
Library project will build automatically whenever any of it's files change. Mention any other details that might be useful.
Read more >
Xcode 11.4 : Building for iOS Simu… | Apple Developer Forums
In Xode 11.4, I encounter a failure in my project. When running my project, it was successfull in Xcode 11.3. Now in Xcode...
Read more >
Building your own Android library - CodePath Cliffnotes
Building your own Android library enables other developers to take advantage of code that you've written. You can share existing activities, services, images, ......
Read more >
Building an Angular Library with multiple entry points | Articles
We'll build a new Angular library from scratch, add multiple subentry points with ... The bad news is that this will not work...
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