Import assignment cannot be used when targeting ECMAScript 2015 modules

后端 未结 7 1034
谎友^
谎友^ 2021-02-05 01:14

I\'m trying to use the follwing line:

import Clipboard = require(\'clipboard\');

and I get the following error:

   [default] c:         


        
7条回答
  •  没有蜡笔的小新
    2021-02-05 01:29

    I had the same problem and changing to:

    import * as myGlobals from "../globals";
    

    fixed the problem. globals.ts file is in the main app folder, and I'm loading it up from subfolder services.

提交回复
热议问题