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

Fix Rcon is not a constructor #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nickdnk
Copy link

@nickdnk nickdnk commented Mar 5, 2024

Hello

This fixes #13 which just broke my system (again).

I'm not very well-versed in node or modules, but I know this makes the package work as a module and prevents the above error, probably without breaking anything else, as I left the normal export default in there.

@nickdnk
Copy link
Author

nickdnk commented Mar 5, 2024

To clarify, the JS output from tsc simply becomes this, which seems to work fine.

// rcon.js
exports.default = RCON;
module.exports = RCON;

I'm using the package like this. All other dependencies in the project work fine using the import statement, just like the readme for this package tells me to do.

// package.json
{
  "type": "module",
  "dependencies": {
    "typescript": "^5.1.6",
    "rcon-srcds": "^2.1.0"
  }
}
// app.ts
import RCON from "rcon-srcds";

new RCON({...});
        
// error

For TypeScript I'm using "target": "ES2022" and "module": "ES2022"

@nickdnk nickdnk mentioned this pull request Mar 5, 2024
@EnriqCG
Copy link
Owner

EnriqCG commented Mar 6, 2024

At first glance, this does not look like it's gonna be an issue. I want to make sure this works properly though, so I'll verify it before merging.

@ari-party
Copy link

I have published Nico's branch to @robertsspaceindustries/rcon-srcds until it is merged and published.

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

Successfully merging this pull request may close these issues.

Rcon is not a constructor
3 participants