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

[🐞] deploy integration node Cannot find package 'undici' imported from entry.node-server.mjs #5369

Closed
sysmat opened this issue Oct 31, 2023 · 8 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@sysmat
Copy link

sysmat commented Oct 31, 2023

Which component is affected?

Qwik Runtime

Describe the bug

  • npm run qwik add node
  • npm run build
  • folder server & dist are build
  • copy folders to my serever & run node entry.node-server I get error:
Cannot find package 'undici' imported from entry.node-server.mjs

Reproduction

aaa

Steps to reproduce

  • npm run qwik add node
  • npm run build
  • folder server & dist are build

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 10.88 GB / 31.75 GB
  Binaries:
    Node: 18.18.2  
    Yarn: 1.22.19 
    npm: 10.0.0
    pnpm: 8.10.0 
  Browsers:
    Chrome: 118.0.5993.118
    Edge: Spartan (44.22000.120.0), Chromium (118.0.2088.76)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @builder.io/qwik: ^1.2.15 => 1.2.15
    @builder.io/qwik-city: ^1.2.15 => 1.2.15
    undici: ^5.27.0 => 5.27.0
    vite: ^4.5.0 => 4.5.0

Additional Information

https://qwik.builder.io/docs/deployments/node/#production-deploy should be more detailed on how to deploy if this meta-framework be more used

@sysmat sysmat added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Oct 31, 2023
@sysmat sysmat changed the title [🐞] deploy integration node [🐞] deploy integration node Cannot find package 'undici' imported from entry.node-server.mjs Oct 31, 2023
@mhevery
Copy link
Contributor

mhevery commented Oct 31, 2023

may be fixed by #5042

@gioboa
Copy link
Member

gioboa commented Nov 1, 2023

This is the entry.node-server.mjs file.

Screenshot 2023-11-01 at 08 58 33

it looks for an external deps so you need to have them in the node_modules folder in the same location of your entry.node-server file.

@sysmat
Copy link
Author

sysmat commented Nov 1, 2023

  • @gioboa thx, I'm new to this meta-framework
  • it would be super in integration & build create node_moduls with dependencies which are actually needed

@sysmat
Copy link
Author

sysmat commented Nov 1, 2023

undici are devDependencies but actually needed at runtime

@gioboa
Copy link
Member

gioboa commented Nov 1, 2023

we can close this issue because it's working as expected.
You can create a PR for you proposal if you want 💪

@gioboa gioboa closed this as completed Nov 1, 2023
@wmertens
Copy link
Member

wmertens commented Nov 2, 2023

undici are devDependencies but actually needed at runtime

This depends on your deploy environment. Undici is an implementation of fetch, it's included in recent node versions. So if you need it in prod you need to add it to your dependencies yourself.

@sysmat
Copy link
Author

sysmat commented Nov 2, 2023

ok, but many building tools do it. I don't know this framework, just experimenting with it. Maybe I'll try to do it(rollup, vite, esbuild are basic building blocks do do it?)

@gioboa
Copy link
Member

gioboa commented Nov 2, 2023

ok, but many building tools do it. I don't know this framework, just experimenting with it. Maybe I'll try to do it(rollup, vite, esbuild are basic building blocks do do it?)

The first idea on top of my head is to create a post build Vite plugin that do this things automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants