Skip to content

Issues with AMD Plugin syntax #5729

Description

@kitsonk

I was trying typescript@next (specifically v1.8.0-dev.20151120) and we extensively use AMD loader plugins, where we use [module id]![resource id]. In v1.6.2 and earlier we would simply declare an ambient declaration describing our module, for example, we have a module that reverts to the CommonJS loader and we would do something like this to load a CommonJS only module in our .d.ts file:

declare module 'intern/dojo/node!http' {
    import http = require('http');
    export = http;
}

And then we would import it in module:

import * as http from 'intern/dojo/node!http';

And everything worked fine. But it seems that at some point, tsc appears to only be matching up to the bang (!) and either reporting the module not found, or matching returning whatever ambient declaration it matches and even with the ambient declaration above, I am getting error TS2307: Cannot find module 'intern/dojo/node'.

I tried to find the related change, but only thing I was aware of was #2709 and that doesn't look like that has been addressed yet.

Is there anyway to get tsc to revert to the previous behaviour?

Activity

  1. changed the title [-]Issues with AMD [/-] [+]Issues with AMD Plugin syantax[/+] on Nov 20, 2015
  2. changed the title [-]Issues with AMD Plugin syantax[/-] [+]Issues with AMD Plugin syntax[/+] on Nov 20, 2015
  3. kitsonk commented on Nov 23, 2015

    @kitsonk
    ContributorAuthor

    Is anyone able to comment on if this is expected behaviour and if there is any way to avoid it?

  4. mhegazy commented on Nov 23, 2015

    @mhegazy
    Contributor

    this is not intentional it is a regression. Vladimir Matveev (@vladima) can you take a look.

  5. mhegazy commented on Nov 24, 2015

    @mhegazy
    Contributor

    Kitson Kelly (@kitsonk) can you give typescript@next a try tonight?

  6. kitsonk commented on Nov 24, 2015

    @kitsonk
    ContributorAuthor

    Yup, works perfectly with v1.8.0-dev.20151124! Thanks Vladimir Matveev (@vladima) and Mohamed Hegazy (@mhegazy)!!!!

  7. 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

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions