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.

I can't get the module to compile within a Typescript node project

See original GitHub issue

Hi,

I have a typescript node project. I’ve used NPM to install the module.

Using import { AlpacaClient, AlpacaStream } from "@master-chief/alpaca"; gives me the error below:

image

It appears it’s trying to use the index.js from the dist/mjs folder, although my module config in compiler options is set to use commonjs. Any idea on how I can get this working? Should I be using one of the bundles?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
awweathercommented, May 5, 2021

Sorry for the confusion! But maybe it’ll help someone that runs into a similar issue

1reaction
awweathercommented, May 5, 2021

Good call, I was on an older version of node. Updated to the most recent stable and it’s working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common TypeScript module problems and how to solve them
Enabling the compiler module resolution tracing in TypeScript can provide insight in diagnosing and solving problems.
Read more >
`Cannot find module` for my own TypeScript module
It was a problem with the tsconfig.json of the project I was using the module in: The module property must be set to...
Read more >
Compiling a TypeScript Module - TutorialsTeacher
Use the following command to compile a TypeScript module and generate the JavaScript code. If you are using IDE, then you have to...
Read more >
Documentation - ECMAScript Modules in Node.js - TypeScript
This code works in CommonJS modules, but will fail in ES modules because relative import paths need to use extensions. As a result,...
Read more >
How to Setup a TypeScript + Node.js Project | Khalil Stemmler
This probably doesn't come as a surprise ;) ... After we install typescript , we get access to the command line TypeScript compiler...
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