-
Notifications
You must be signed in to change notification settings - Fork 62
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
CDN script error: "Uncaught ReferenceError: vuePropertyDecorator is not defined" #53
Comments
Hello, I will be checking and I will try to bring a solution as soon as possible. |
Please don't feel any pressure to fix this quickly, this isn't super important. I don't know exactly how to fix, sorry. I can help you research if necessary. I noticed your webpack config doesn't declare |
See the rollup.config.js file, it contains the build settings. |
Reproduction link (open console): https://jsfiddle.net/guanzo/9dvyfncb/
The script url: https://unpkg.com/[email protected]/lib/v-emoji-picker.unpkg.js
I'm actually submitting my application for review very soon, so would appreciate a quick fix. No rush though!!!
EDIT: Okay after digging for 5 hours, I've determined your CDN files, meant to be loaded by
<script>
tags, are incorrect.Just for some context, I'm developing a twitch.tv extension. It's much easier to pass the review process if you load libraries from a CDN instead of using webpack to bundle everything into a single file. Therefore, in development, I'm importing the library from
node_modules
with webpack. When building for production, I instead load the CDN file with a<script>
tag.Here are a few issues I found with your CDN file.
You're looking for the
vuePropertyDecorator
global, but it's actuallyVuePropertyDecorator
. The first "v" is capitalized.I had to include the CDN versions of
vue-class-component
andvue-property-decorator
in order to load your library without errors. First, I only includedvue-property-decorator
. But then it errored because it was trying to run code from thevue-class-component
lib, so I had to include that too. After that, your library was loaded and working.I shouldn't have to do all that. Your CDN file should include all necessary dependencies.
The real problem.
Example file:
In development (npm), it logs![](https://camo.githubusercontent.com/aefeda059f4e68576db75d475e4b96c7789cf1192b6116624d2302aedf36d556/68747470733a2f2f692e6779617a6f2e636f6d2f32316539613933306431616563346338656234636662653730623132323263622e706e67)
In production (CDN), it logs![](https://camo.githubusercontent.com/744df0b642ed53d13380d5f171b552cab0a42b7e1a8c6b58f66ec85c4978f634/68747470733a2f2f692e6779617a6f2e636f6d2f61326637346538656664386263313235336361646136643431636266323537382e706e67)
And therein lies the problem. The module exports are different. The component registration fails, because
VEmojiPicker
is not a valid component.The expectation is that the above code works whether i've loaded the library from npm or a CDN file.
Here's my hacky fix.
I will submit my application in ~24 hours, whether or not you've fixed it by then.
The text was updated successfully, but these errors were encountered: