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

[ FEATURE ] Support for ES6 imports #88

Closed
sanjaybaskaran01 opened this issue May 8, 2022 · 1 comment
Closed

[ FEATURE ] Support for ES6 imports #88

sanjaybaskaran01 opened this issue May 8, 2022 · 1 comment
Labels

Comments

@sanjaybaskaran01
Copy link

I've been trying to import cookieParser, it seems that there are no default exports setup for them.

import cookieParser from 'cookie-parser'; // Does not work

Could not find a declaration file for module 'cookie-parser'. '/node_modules/cookie-parser/index.js' implicitly has an 'any' type.

Expected Outcome:

import cookieParser from 'cookie-parser';

or

import * as cookieParser from 'cookie-parser';

Should import cookieParser

@dougwilson
Copy link
Contributor

Hello, and thank you for your report. You can indeed import this module using es6. But the error you are showing is not from javascript/es6, rather from typescript. Here is an article that found which should help you: https://bobbyhadz.com/blog/typescript-could-not-find-a-declaration-file-for-module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants