Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9045613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:23:25+00:00 2026-06-16T11:23:25+00:00

error message Compile Error. See error list for details …/Scripts/gallery.ts(13,15): The name ‘Size’ does

  • 0

error message

Compile Error.
See error list for details
…/Scripts/gallery.ts(13,15): The name ‘Size’ does not exist in the current scope

gallery.ts

/// <reference path="jquery.d.ts" />
/// <reference path="jquery.custom.js" />

(function ($) {
    var $body = $(document.body);
    var $win = $(window);
    var animTime = 1000;
    var $cg = $('#control_grid').data('flash', false);

    function fitImage(img, max, enlarge) {
        var ratio = Math.max(img.width / max.width, img.height / max.height);
        if (ratio < 1 && !enlarge) ratio = 1;
        return Size(Math.round(img.width / ratio), Math.round(img.height / ratio));
    }

    ...

jquery.custom.js

function Size(w, h) {
    return {
        'width': w,
        'height': h
    };
}

...

question

When I mouse over “Size” in gallery.ts in Visual Studio it pulls up the correct definition, so clearly it can find the function. Why is the TS compiler giving me this error then?

The Size() function is at root level in jquery.custom.js, it should have global scope, no?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:23:27+00:00Added an answer on June 16, 2026 at 11:23 am

    You won’t get type information by referencing a JavaScript file. You could either write that function in TypeScript, or create a definition file for it, i.e. jquery.custom.d.ts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code does not want to compile. See the included error message. Code:
My Error message: Request for member nameField in something not a struct or union
As the error message stated below, I do not use user_profiles_path as plural because
I have this code that does not compile anymore since I am on last
I'm curious to know why the C# compiler only gives me an error message
Is there a comprehensive list of error/warning messages for the g++ compiler available online?
Error message doesn't display on mysql connect failure if( ! $this->remote_connection_id = @mysql_connect($vars['hostname'], $vars['username'],
When error message is a long string, how to make the message be displayed
The error message I gen when I try to access the web page server
Complete error message: Error 1 error C2678: binary '!=' : no operator found which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.