question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Can't import random JS module in TS without Typings

See original GitHub issue

Is 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

image

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:

image image image image

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:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ianschmitzcommented, Jan 17, 2019

You should be able to disable noImplicitAny in tsconfig.json to get around this as well.

0reactions
stale[bot]commented, Mar 24, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found