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.

Typescript typings error on openUrl

See original GitHub issue

What happened?

There seems to be an issue with the typings from open URL:

      openURL(url, null, {
        width: '1050'
      })

Argument of type 'null' is not assignable to parameter of type '((...args: any[]) => any) | undefined'.

Yet the docs provide null as the example: https://quasar.dev/quasar-utils/other-utils#open-external-url

What did you expect to happen?

Null be accepted instead of a function.

Reproduction URL

N/A

How to reproduce?

Start a Quasar typescript project and use the command:

      openURL(url, null, {
        width: '1050'
      })

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Electron Mode

Platforms/Browsers

No response

Quasar info output

Operating System - Darwin(21.6.0) - darwin/arm64
NodeJs - 16.16.0

Global packages
  NPM - 8.11.0
  yarn - 3.2.3
  @quasar/cli - 1.3.2
  @quasar/icongenie - 2.5.3
  cordova - Not installed

Important local packages
  quasar - 2.7.7 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.0.6 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.15.1 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.37 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.3
  pinia - 2.0.20 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 2.9.15 -- Native-ESM powered web dev build tool
  eslint - 8.22.0 -- An AST-based pattern checker for JavaScript.
  electron - 20.0.3 -- Build cross platform desktop apps with JavaScript, HTML, and CSS
  electron-packager - 15.5.2 -- Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Relevant log output

No response

Additional context

I am build Electron apps, but don’t think it’s relevant.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
IlCallocommented, Sep 1, 2022

@maggie0002 could you open a PR fixing the docs to use undefined instead of null? 😃

0reactions
yusufkandemircommented, Aug 31, 2022

Typings are configured to include undefined but not null. The code is configured to be run properly with any falsy value(undefined, null, 0, '', etc.). So, “officially” declaring only undefined to be passed and updating the docs to reflect that makes more sense to me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/openurl - npm
This package contains type definitions for openurl (https://github.com/rauschma/openurl). Details. Files were exported from https://github.com/ ...
Read more >
TypeScript compile error due to typings - Stack Overflow
I'm using typescript 1.7.5, typings 0.6.9 and angular 2.0.0-beta.0. How can I get rid of the typescript compile error messages Duplicate ...
Read more >
[got] error TS2304: Cannot find name 'URL' #19799 - GitHub
I get this error when trying to use typings for the got package: ... URL is available in the dom typings provided by...
Read more >
Window open() Method - W3Schools
The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values. See Also:...
Read more >
WebDocumentViewer - Documentation
Function to execute when the scroll operation is finished. openUrl(documenturlopt, annotationsurlopt, formurlopt, callbackopt).
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