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

Wrong error when using Quasar UMD without including Vue script tag #4020

Closed
tomers opened this issue May 2, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@tomers
Copy link
Contributor

commented May 2, 2019

Using https://cdn.jsdelivr.net/npm/quasar@1.0.0-beta.20/dist/quasar.umd.js while trying to integrate Quasar in an existing project.

I did not include vue.min.js for some reason (irrelevant here), however, the script fails:

quasar.umd.js:1642 Uncaught TypeError: Cannot read property 'extend' of undefined
    at quasar.umd.js:1642
    at quasar.umd.js:10
    at quasar.umd.js:11

This is despite the fact the the script is supposed to catch such case, e.g. in line 27609:

if (Vue === void 0) {
    console.error('[ Quasar ] Vue is required to run. Please add a script tag for it before loading Quasar.');
  }

I expect the script to throw proper error message in case Vue does not exists.

Reference: application.haml (Rails code):

%head
  %title My App
  %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}

  = stylesheet_link_tag 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons'
  = stylesheet_link_tag "https://cdn.jsdelivr.net/npm/quasar@1.0.0-beta.20/dist/quasar.min.css"

  = stylesheet_link_tag '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'
  = stylesheet_link_tag '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css'
  = stylesheet_link_tag 'application', media: 'all'

  = javascript_include_tag '//code.jquery.com/jquery-2.2.3.min.js'
  = javascript_include_tag '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'
  = javascript_include_tag '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js'
  = javascript_include_tag '//cdn.jsdelivr.net/npm/@shopify/draggable@1.0.0-beta.8/lib/sortable.js'

  = javascript_include_tag 'application', media: 'all'
  = javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/json-editor/0.7.28/jsoneditor.min.js"

  = javascript_include_tag "https://cdn.jsdelivr.net/npm/quasar@1.0.0-beta.20/dist/quasar.umd.js"
@smolinari

This comment has been minimized.

Copy link
Collaborator

commented May 2, 2019

Unsafe use? I think that title needs rewording to avoid misinterpretation. This isn't about a security issue, which "Unsafe use" infers.

Scott

@rstoenescu rstoenescu changed the title Unsafe use of Vue object in Quasar UMD source Wrong error when using Quasar UMD without including Vue script tag May 2, 2019

@rstoenescu

This comment has been minimized.

Copy link
Member

commented May 2, 2019

Good point, @smolinari . Changed the title to a more appropriate one.

@rstoenescu

This comment has been minimized.

Copy link
Member

commented May 2, 2019

Fix will be available in beta.21.
Thanks for reporting.

@rstoenescu rstoenescu closed this May 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.