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

Does not work with Stable Elysia@v1 #11

Closed
cybercoder-naj opened this issue Mar 25, 2024 · 5 comments
Closed

Does not work with Stable Elysia@v1 #11

cybercoder-naj opened this issue Mar 25, 2024 · 5 comments

Comments

@cybercoder-naj
Copy link

IP returns null. There are breaking changes with Elysia@v1. See #513.

Versions

  • elysia-ip: 0.0.7
  • elysia: 1.0.9

Reproduction

const app = new Elysia()
  .use(ip())
  .get('/', ({ ip }) => {
    console.log("ip", ip); // logs "ip null"
    return "Hello"
  })
@gaurishhs
Copy link
Owner

hi, thanks for reporting. Published a released which is working with Elysia v1. The module is also 1.0 now.

@cybercoder-naj
Copy link
Author

image

As for the newer version of elysia-ip, we cannot find its declaration. I went through your changes and it seems you removed the "main" field in package.json. It is specified so in the docs

@gaurishhs
Copy link
Owner

Here it is

@cybercoder-naj
Copy link
Author

I am not sure whether is it a problem with my tsconfig.json. I followed the answers in this thread but I had no luck.

Under node_modules/elysia-ip, I changed your package.json to include this line and it solves the issue.

  "main": "./dist/index.js"

I don't know how exports work with package.json but it seems it is not compatible with all module types.

gaurishhs added a commit that referenced this issue Mar 27, 2024
@gaurishhs
Copy link
Owner

hi, thanks for this fix. please update to v1.0.2 (latest) containing this fix

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

No branches or pull requests

2 participants