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

I'm having error though, when running in ssr mode: '[nuxt] [request error] [unhandled] [500] Cannot find module './lib/axios' #31

Closed
SaulAbreu opened this issue Jul 26, 2023 · 16 comments
Labels
bug Something isn't working

Comments

@SaulAbreu
Copy link

Version

nuxt-medusa
nuxt:

Reproduction Link

Steps to reproduce

What is Expected?

What is actually happening?

@SaulAbreu SaulAbreu added the bug Something isn't working label Jul 26, 2023
@fsyntax
Copy link

fsyntax commented Aug 2, 2023

Experiencing the same here on fresh projects.
I did notice that the most recent version of the medusa-js client is ^6.0.2 - compared to the version in this module (^1.3.10)

@SaulAbreu
Copy link
Author

The error was I set the NITRO PORT to 8000 as env variable in Netlify, when is it not needed.

@fsyntax
Copy link

fsyntax commented Aug 2, 2023

How does that even relate? For me this is happening on a local environment, fresh Nuxt 3 install..

@SaulAbreu
Copy link
Author

If this happen on local check in medusa config of the backend the STORE_CORS and set the same port as Nuxt uses. Also set the MEDUSA_URL in the env file to the localhost:9000 by default.

@fsyntax
Copy link

fsyntax commented Aug 2, 2023

Thanks for the advice, but the medusa config itself is fine. When working with the @medusajs/medusa-js client itself, it's working. Hence my note about the client version in the module

@dimitrio-m
Copy link
Contributor

dimitrio-m commented Oct 19, 2023

Hello! I'm currently having the same issue after starting a fresh project. I followed this guide and got the same error as the title of the issue. Do you guys know about a workaround or something?

BTW: I am running Nuxt on port 8000 and Medusa API on port 9000 as the default value suggests.

@Baroshem
Copy link
Collaborator

Hey,

I have encountered this issue some time ago but now it disapeared and was not occuring anymore. The problem I had was related to client vs browser usage of this package. When I have implemented one solution it was breaking the other one. So I decided to stay with the current one as it was not causing any problems for me. I will reopen this issue and try to experiment in the upcoming days but I will be also working on other packages so if anyone would be up for doing some reasearch please do so :)

@Baroshem Baroshem reopened this Oct 23, 2023
@dimitrio-m
Copy link
Contributor

dimitrio-m commented Oct 23, 2023

@Baroshem I'm a noob with anything related to open source and npm packaging, but I think it has something to do with the npm package configuration. I tested it locally and it works great. I also linked the module locally from my project and it worked flawlessly. I linked both, the src/module.ts and the dist/module.cjs. I don't know if that is how that is supposed to be tested but it worked.

Note: When I tried to run yarn run prepack without building the playground environment first, it threw some error that said that it couldn't find some typescript configuration files. I don't know if the playground environment should be built before publishing a release or not, but that seemed relevant.

Edit: I will investigate further, if I manage to solve the issue, I will submit a PR :)

@Baroshem
Copy link
Collaborator

Hey guys, @dimitrio-m created a PR with a fix (and general refactor - thanks for that! 💚)

Could you check if the error persists on 0.5.0 version?

@dimitrio-m
Copy link
Contributor

Hello @Baroshem ! I'm glad that the PR got merged! I would like to help you maintain this module 😄

Regarding the fix, I tried importing it in a new project and it worked. I also tried importing it in a new project following the Authoring Nuxt Layers Guide and it worked there too.

@Baroshem
Copy link
Collaborator

@dimitrio-m I am more than happy to see that!

Feel free to suggest any changes to the module and lets make it great together! 🚀

@Baroshem
Copy link
Collaborator

@SaulAbreu @fsyntax

Could you check if it works right now?

@fsyntax
Copy link

fsyntax commented Oct 30, 2023

@SaulAbreu @fsyntax

Could you check if it works right now?

For me, everything works like a charm now :) Thanks!

@evan959
Copy link

evan959 commented Apr 24, 2024

it's not work,this my dependencies

"nuxt": "^3.11.2",
"vue": "^3.4.21",
"vue-router": "^4.3.0"

@Baroshem
Copy link
Collaborator

Hey @evan959 could you please create a new issue with reproduction steps or repo?

@evan959
Copy link

evan959 commented Apr 25, 2024

ok, @Baroshem I created new issuse, please take a look

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

No branches or pull requests

5 participants