[Bug] Can't import random JS module in TS without Typings
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
TypeScript module augmentation seems to be the main one, though i did search including the error code ts-1208
Environment
Steps to Reproduce
I’m installing a three.js plugin in a TypeScript project, unfortunately it doesn’t have type definitions, so i have trouble when importing, tried to create a module definition with no luck:
Expected Behavior
I expected to import a random JS module that has no Typings definition & maybe be forced to write a simple empty definition for it.
Actual Behavior
I was trying to put flag isolatedModules
to false to be able to define the typing definition but build process keeps reverting to true, which seems to block me from creating the definition.
Reproducible Demo
As soon as i have more time.
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to import node module in TypeScript without type ...
The trick is to use purely JavaScript notation: const co = require('co');.
Read more >How to fix error TS7016: Could not find a declaration file for ...
The second part of the error says: Try `npm install @types/XYZ` if it exists or add a new declaration (.d.ts) file containing `declare...
Read more >Content Types - ESBuild
All modern JavaScript syntax is supported by esbuild. ... Specifically this means that importing a non-object value from a CommonJS module with ESM...
Read more >Common TypeScript module problems and how to solve them
A strong background in JavaScript and TypeScript; A firm understanding of TypeScript modules system. Problem 1: Irregular location of ...
Read more >random-js - npm
A mathematically correct random number generator library for JavaScript.. Latest version: 2.1.0, last published: 4 years ago.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You should be able to disable
noImplicitAny
intsconfig.json
to get around this as well.This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.