Error:(12, 27) TS2307: Cannot find external module 'TweenMax'. (require.js)
Hi -
the typescript file gives me the above error, the compiled javascript is fine.
So it's more of an irritation than a real problem.
My ts file:
import d3 = require('d3');
import TweenMax = require('TweenMax');
This is how the js file starts:
define(["require", "exports", 'd3', 'TweenMax', "events/event"], function (require, exports, d3, TweenMax, CustomEvent) {})
I have the definition files:
/// <reference path="../../typings/greensock/greensock.d.ts" />
/// <reference path="../../typings/d3/d3.d.ts" />
Code completion does work for TweenMax --> cmd-click takes me to the definition file.
What could cause the above error?
Thank you for your help!
Ulrich Sinn
Please sign in to leave a comment.
greensock.d.ts is not an external module - that's the problem.
So you can't use import here. See https://typescript.codeplex.com/wikipage?title=Modules%20in%20TypeScript, https://github.com/Microsoft/TypeScript/issues/2712