私はpackage.json
に次のように書いていますので、私はそれが必要なものを提供していると推測します。フェッチAPIを使用しているときにリクエスト/レスポンスをインポートするにはどうすればよいですか?
"@types/whatwg-fetch": "0.0.27",
私は必要なクラスはRequest
とRespsonse
ように見えます。私はインポートすることができますどのように
stat /home/xenoterracide/IdeaProjects/rpf-ui/node_modules/@types/whatwg-fetch/index.d.ts
File: '/home/xenoterracide/IdeaProjects/rpf-ui/node_modules/@types/whatwg-fetch/index.d.ts'
Size: 2662 Blocks: 8 IO Block: 4096 regular file
Device: fe00h/65024d Inode: 7750050 Links: 1
Access: (0644/-rw-r--r--) Uid: (1000/xenoterracide) Gid: (1000/xenoterracide)
Access: 2016-08-08 19:18:56.205552681 -0500
Modify: 2016-07-14 08:52:54.000000000 -0500
Change: 2016-08-08 19:17:19.288571256 -0500
Birth: -
File '/home/xenoterracide/IdeaProjects/rpf-ui/node_modules/@types/whatwg-fetch/index.d.ts' is not a module.
、まだ
WebPACKのdevのサーバーからエラーを私はこれを試してみましたが、IntelliJのは、それは間違っていると言うと、そうWebPACKのサーバが行うimport { Request, Response } from 'whatwg-fetch';
これらのクラス?
あなたが応答している間に更新していましたが、それらがインストールされていました。オリジナルの質問でさえ、 'package.json'でそれが示されました。 – xenoterracide
intellijの問題?もしあなたがtypescriptを使っているのであれば、vscodeを試してみるのはあなた自身に本当にありがたいことです。 –
エラーはdevサーバからのものです – xenoterracide