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

Issues with AMD Plugin syntax #5729

Closed
kitsonk opened this issue Nov 20, 2015 · 4 comments · Fixed by #5759
Closed

Issues with AMD Plugin syntax #5729

kitsonk opened this issue Nov 20, 2015 · 4 comments · Fixed by #5759
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Nov 20, 2015

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?

@kitsonk kitsonk changed the title Issues with AMD Issues with AMD Plugin syantax Nov 20, 2015
@kitsonk kitsonk changed the title Issues with AMD Plugin syantax Issues with AMD Plugin syntax Nov 20, 2015
@kitsonk
Copy link
Contributor Author

kitsonk commented Nov 23, 2015

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

@mhegazy
Copy link
Contributor

mhegazy commented Nov 23, 2015

this is not intentional it is a regression. @vladima can you take a look.

@mhegazy mhegazy added Bug A bug in TypeScript High Priority labels Nov 23, 2015
@mhegazy mhegazy added this to the TypeScript 1.8 milestone Nov 23, 2015
@vladima vladima added the Fixed A PR has been merged for this issue label Nov 23, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Nov 24, 2015

@kitsonk can you give typescript@next a try tonight?

@kitsonk
Copy link
Contributor Author

kitsonk commented Nov 24, 2015

Yup, works perfectly with v1.8.0-dev.20151124! Thanks @vladima and @mhegazy!!!!

basarat added a commit to TypeStrong/atom-typescript that referenced this issue Nov 24, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants