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.

Readonly issues when using vue externally (CDN)

See original GitHub issue

Describe the bug

I am receiving multiple readonly errors form bootstrap-vue modules when loading Vue from a CDN, the errors in question were discussed extensively in #3040.

Steps to reproduce the bug

  1. Load in vue via https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.runtime.js
  2. Import some bootstrap-vue components: import { BCard, BCollapse, VBToggle } from 'bootstrap-vue';
  3. Build a component (UMD format).
  4. Open browser
  5. Components work as expected (more or less) but console is full of errors.

Expected behavior

No console errors.

Versions

Libraries:

  • BootstrapVue: 2.1.0
  • Bootstrap: 4.4.1
  • Vue: 2.6.10

Environment:

  • Device: Desktop
  • OS: Ubuntu 18.10
  • Browser: Chrome
  • Version: 79.0.3945.88

Demo link

It is difficult to put together because I have a fairly custom build process, I am hoping it is obvious based on the description, if not I can try to put a demo together by just copy/pasting a built component.

Additional context

This has only become an issue in recent versions of bootstrap-vue I think it may be to do with portal-vue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chopfitzroycommented, Jan 8, 2020

Got it!

Needed to be:

{
        input: 'src/components/ExampleComponent.vue',
        external: ['vue'],
        output: {
                name: 'example_component',
                file: 'dist/example_component.umd.min.js',
                format: 'umd',
                globals: {
                        vue: 'Vue'
                }
        }
}
0reactions
chopfitzroycommented, Jan 8, 2020

Hey @tmorehouse,

Bizzare, I will keep looking into this and post if I find a solution.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"$attrs is readonly","$listeners is readonly","Avoid mutating a ...
In my case, I was migrating from a project that didn't use VueCLI. In that project, I imported vue from a CDN <script ......
Read more >
Custom Directives - Vue.js
Custom directives should only be used when the desired functionality can only be achieved via direct DOM manipulation. Prefer declarative templating using built ......
Read more >
Add External Scripts - Gridsome
If you want to use a external JavaScript library inside your component, you can do so by importing the package and requiring it...
Read more >
Vue.js | IntelliJ IDEA Documentation - JetBrains
You can still use Vue CLI, if you choose this option IntelliJ IDEA also downloads and ... Open the HTML file with a...
Read more >
Vue Integration - CKEditor 4 Documentation
editor-url; type; config; tag-name; value; v-model; read-only; throttle. Component events ... The CKEditor 4 Vue component is compatible with Vue.js 2.x.
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