-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Main package should be compiled for node env #655
Comments
Oops, the electron app will not work after compilation when |
Also related issue vitejs/vite#4405 |
Hmmm... |
Wow, thanks for the fast response, I will check 🙂 Also related axios/axios#456 |
@cawa-93 this error happens when I running the compiled version The |
Btw I am getting the same error for |
🤔 I just tried run compilation with |
It seems you can import axios from relative path: import axios from '../../../node_modules/axios'; That force Vite does't resolve |
Oops, I used yarn workspaces, and that what the reason why some node packages were not loaded. Btw, I still think that the main package should use
|
You may be right. But I need more tests and research for that change |
It seems build in |
Should be resolve in d002d6f |
I had an issue with the axios library when I was using axios in the main package, the code was resolving to the XHR adapter. It was happening due to this field in package.json of axios:
It means that for browser env
./lib/adapters/http.js
file should be replaced with./lib/adapters/xhr.js
, but main package is running under node environment, and it was causing the error. Here is the more detailed issue vitejs/vite#6382 .So, I fixed it with
ssr: true
in the build section of config.vite.js. What do you think about this? I can provide PR if you want 🙂The text was updated successfully, but these errors were encountered: