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

[nuxt-client] @hey-api/client-nuxt breaks production server #1723

Open
lvaroqui opened this issue Feb 16, 2025 · 6 comments · May be fixed by #1758
Open

[nuxt-client] @hey-api/client-nuxt breaks production server #1723

lvaroqui opened this issue Feb 16, 2025 · 6 comments · May be fixed by #1758
Labels
bug 🔥 Something isn't working

Comments

@lvaroqui
Copy link

lvaroqui commented Feb 16, 2025

Description

When using @hey-api/client-nuxt somewhere in the nuxt app, the production build is broken.

Reproducible example or configuration

This is easily reproducible with the example in this repo:

cd examples/openapi-ts-nuxt
pnpm install # I had to replace the `workspace:*` part in my dependencies with the actual version number
pnpm run build
node .output/server/index.mjs

Then try to load the page at http://localhost:3000, and the servers throws an internal error:

[nuxt] [request error] [unhandled] [500] Package import specifier "#build/nuxt.config.mjs" is not defined in package /tmp/openapi-ts/examples/openapi-ts-nuxt/.output/server/node_modules/nuxt/package.json imported from /tmp/openapi-ts/examples/openapi-ts-nuxt/.output/server/node_modules/nuxt/dist/app/nuxt.js

[nuxt] [request error] [unhandled] [500] Package import specifier "#build/nuxt.config.mjs" is not defined in package /tmp/openapi-ts/examples/openapi-ts-nuxt/.output/server/node_modules/nuxt/package.json imported from /tmp/openapi-ts/examples/openapi-ts-nuxt/.output/server/node_modules/nuxt/dist/app/nuxt.js

The error is unfortunately not very descriptive, but I think it is related to the way @hey-api/client-nuxt imports the nuxt/app module. I suspect '@hey-api/client-nuxt' should be a nuxt plugin or nuxt module

OpenAPI specification (optional)

No response

System information (optional)

No response

@lvaroqui lvaroqui added the bug 🔥 Something isn't working label Feb 16, 2025
@mrlubos
Copy link
Member

mrlubos commented Feb 16, 2025

Hi @lvaroqui, does this fix it for you? #1660 (comment)

@lvaroqui
Copy link
Author

lvaroqui commented Feb 16, 2025

Hi @mrlubos, it does indeed! I can't believe I didn't see the issue after looking around for 3 hours T_T

I think this should be addressed in the README and updated in the example. In the best case, user shouldn't be able to run into this issue!

@eszterczotter
Copy link

The mentioned solution works for me too, but I have a feeling it can only be a temporary one. I agree with @lvaroqui about what’s causing the issue. I don’t think this should be included in the readme or the docs.

@lvaroqui
Copy link
Author

I spent 3 hours finding the root cause of the issue yesterday. So, until a proper fix is implemented, updating the README and doc seems pretty useful so others don't run into the same problem!

@eszterczotter
Copy link

eszterczotter commented Feb 17, 2025

If it won't become the final solution then sure, that would also help. I also spent half a day with this issue.

@mrlubos mrlubos linked a pull request Feb 27, 2025 that will close this issue
@mrlubos
Copy link
Member

mrlubos commented Feb 27, 2025

This will be fixed soon, thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants