GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Incorrect emit when using external module import in JSX tag · Issue #3674 · microsoft/TypeScript

Incorrect emit when using external module import in JSX tag #3674

New issue
Copy link
New issue
Copy link
Closed
Closed
Incorrect emit when using external module import in JSX tag#3674
Copy link
Assignees
RyanCavanaugh
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
TypeScript 1.6

Description

@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)
opened on Jun 29, 2015
Issue body actions

From Prabir Shrestha (@prabirshrestha) (thanks!) at #3564 (comment)


Tried building tsc locally and running this.

jake LKG
node ..\bin\tsc.js --jsx react -m umd -t es5 app.tsx button.tsx

app.tsx:

/// <references file="./react.d.ts"/>

import * as React from 'react';

import { Button } from './button';

export class App extends React.Component<any, any> {

    render() {
        return <Button />;
    }

}

button.tsx

import * as React from 'react';

export class Button extends React.Component<any, any> {

    render() {
        return <button>Some button</button>;
    }

}

The output app.js does not seem to set the button as a dependency.

/// <references file="./react.d.ts"/>
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
(function (deps, factory) {
    if (typeof module === 'object' && typeof module.exports === 'object') {
        var v = factory(require, exports); if (v !== undefined) module.exports = v;
    }
    else if (typeof define === 'function' && define.amd) {
        define(deps, factory);
    }
})(["require", "exports", 'react'], function (require, exports) {
    var React = require('react');
    var App = (function (_super) {
        __extends(App, _super);
        function App() {
            _super.apply(this, arguments);
        }
        App.prototype.render = function () {
            return React.createElement(button_1.Button, null);
        };
        return App;
    })(React.Component);
    exports.App = App;
});

This makes button_1 undefined. Even with -m amd it doesn't seem to work. Am I missing something here or is this a bug?

Activity

  1. Ryan Cavanaugh (RyanCavanaugh)
    added
    BugA bug in TypeScriptA bug in TypeScript
    on Jun 29, 2015
  2. Ryan Cavanaugh (RyanCavanaugh)
    self-assigned this
    on Jun 29, 2015
  3. Ryan Cavanaugh (RyanCavanaugh)
    added this to the TypeScript 1.6 milestone on Jun 29, 2015
  4. Ryan Cavanaugh (RyanCavanaugh)
    added
    FixedA PR has been merged for this issueA PR has been merged for this issue
    on Jun 30, 2015
  5. Ryan Cavanaugh (RyanCavanaugh)
    closed this as completedon Jun 30, 2015
  6. microsoft
    locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @RyanCavanaugh
    Ryan Cavanaugh (RyanCavanaugh)

Labels

BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

Type

No type

Projects

No projects

    Milestone

    • TypeScript 1.6

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.