Comments (12)
Okay, thanks for the info and the "temporary" solution.
That's way better than my workaround. I've implemented it and it works so far.
Let's hope they'll implement it soon.
from tle.js.
Great, glad that works! I am seeing a similar error with a simple Node project so I think I may be packaging it a bit wrong as well, looking into this!
from tle.js.
Oof, thanks for the heads up, I'm not sure what's going on there. As a workaround you'll have to lock it down to the prior version for now (npm i [email protected]
). Sorry for the hassle!
from tle.js.
Yes, that's what I did already.
But thanks anyways for the help so far.
from tle.js.
When you have a chance, please try again with 4.5.3
, I believe I finally tracked down the issue! Thanks again.
from tle.js.
Okay, I tested it.
It works so far. No errors and the functions I'm using are executing normally, as far as I see. Even with Nest.js.
Thanks very much!
from tle.js.
Thanks for the heads up, it looks like Nest.js doesn't yet support ES Modules: nestjs/nest#8736 (also see nestjs/nest#7021)
The good news is that it's a quick fix for you - you can tell it to explicitly use the CommonJS dist instead:
const { getLatLngObj } = require("tle.js/dist/tlejs.cjs");
I verified this works by running their TypeScript starter project and outputting some test code in their app.service.ts
Hello World (note that I'm using Node 16.13.1
):
import { Injectable } from '@nestjs/common';
const { getLatLngObj } = require("tle.js/dist/tlejs.cjs");
const tle = `ISS (ZARYA)
1 25544U 98067A 17206.18396726 .00001961 00000-0 36771-4 0 9993
2 25544 51.6400 208.9163 0006317 69.9862 25.2906 15.54225995 67660`;
@Injectable()
export class AppService {
getHello(): string {
return `Hello World! ${JSON.stringify(getLatLngObj(tle))}`;
}
}
from tle.js.
In tle.js 4.5.0
I've added Node.js conditional exports support which seems to resolve the issue!
from tle.js.
Unfortunately when I try to import this version with TypeScript into my Nest.js project, that fails with a "Can't find module declaration or corresponding type declaration" (Even my IDE (vs-code) shows this...).
Maybe this is a problem again with Nest.js but it looks like a TypeScript thing to me. Maybe something with my TypeScript config?
Additionally the other way you described before now gives an error:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/tlejs.cjs' is not defined by "exports" in <redacted>/node_modules/tle.js/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
at resolveExports (internal/modules/cjs/loader.js:449:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (<redacted>/src/services/spacecraft-data.service.ts:5:84)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
from tle.js.
Woo! Good stuff, thanks for your patience!
from tle.js.
@davidcalhoun can you close this?
from tle.js.
Sounds good, closing this out!
from tle.js.
Related Issues (20)
- Accuracy of AZ and EL HOT 4
- Remove extra TLEs from test file HOT 1
- getVisibleSatellites return empty array HOT 5
- re-add support for commonJS? HOT 3
- Caching based on Satellite name causes incorrect return values HOT 1
- typescript types :( HOT 2
- How to get range sat? HOT 3
- README states order of LngLat twice in the same way HOT 2
- getGroundTracks returning strange values randomly; sometimes tracks equal each other or are completely wrong HOT 6
- Problems with unusual/extreme orbits HOT 2
- In cesuim, I want draw the orbit of the satellite, through tle.js HOT 4
- memory leak? HOT 3
- TypeScript types error: getEpochTimestamp() needs an argument, but doesn't accept one HOT 3
- getEpochTimestamp returning NaN HOT 9
- Invalid result from checking parsedTLE against "isTLEObj"
- Accidental issue HOT 1
- How I can determine the time when the middle track returned by getGroundTracks ends? HOT 1
- getGroundTracks isn't generating points all the way to the antemeridian HOT 10
- TLE Data parsing Issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tle.js.