-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed
Closed
Copy link
Description
Describe the issue
what is the correct way to import axios
in node using CommonJS in order to use the typings? i am not using typescript unlike this issue
Example Code
const axios = require('axios'); // no typings but everything still works
const axios = require('axios').default; // has typings and everything works
Expected behavior, if applicable
i expected to have typings for vscode intellisense when importing axios
using CommonJS require()
syntax described in the documentation.
i did not see any information about having to append .default
to the import. maybe worth including this in the docs? for the record the import still works (axios.get()
etc) but there is no typing intellisense.
Environment:
- Axios Version: 0.19.0
- OS: OSX 10.14.5
- node: 10.15.3
- vscode: 1.34.0
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
briancodes, lieuweberg and maixuanhan
Metadata
Metadata
Assignees
Labels
No labels