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

[Bug?]: anonymous server functions bundled in wrong place #1261

Closed
2 tasks done
bsl-zcs opened this issue Jan 15, 2024 · 2 comments
Closed
2 tasks done

[Bug?]: anonymous server functions bundled in wrong place #1261

bsl-zcs opened this issue Jan 15, 2024 · 2 comments
Labels
bug Something isn't working vinxi related to vinxi

Comments

@bsl-zcs
Copy link

bsl-zcs commented Jan 15, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

when the "use server" pragma is used in an anonymous function it works fine in development mode, but fails after compilation with an error message containing a path to a file in a .vinxi subdirectory instead of .output.

[nitro] [request error] [unhandled] Cannot find module '/home/projects/stackblitz-starters-66vw6a/.vinxi/build/server-fns/_server/c_8238.js' imported from /home/projects/stackblitz-starters-66vw6a/.output/server/chunks/nitro/node-server.mjs

moreover, such file references are stored in compiled .output/server/chunks/nitro/node-server.mjs as absolute paths on the machine where the bundle was built. not sure if it should be filed as a separate issue.

Expected behavior 🤔

a server function should work

Steps to reproduce 🕹

Steps:

  1. open https://stackblitz.com/edit/solidstart-bug-66vw6a?file=src%2Froutes%2Findex.jsx
  2. npm run build in terminal
  3. npm run start in terminal
  4. click on "server" button

Context 🔦

No response

Your environment 🌎

No response

@KagChi
Copy link

KagChi commented Jan 27, 2024

this issue still persist with latest solidstart

@KagChi
Copy link

KagChi commented Jan 27, 2024

https://bin.hzmi.xyz/ixanilokiv

[nitro] [request error] [unhandled] Cannot find module 'E:@KagChi\KagChi.vinxi\build\server-fns_server\c_5221.js' imported from E:@KagChi\KagChi.output\server\chunks\nitro\node-server.mjs at new NodeError (node:internal/errors:406:5)
at finalizeResolution (node:internal/modules/esm/resolve:233:11)
at moduleResolve (node:internal/modules/esm/resolve:845:10)
at defaultResolve (node:internal/modules/esm/resolve:1043:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
at ModuleLoader.import (node:internal/modules/esm/loader:315:34)
at importModuleDynamically (node:internal/modules/esm/translators:109:35)
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:141:14)

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

No branches or pull requests

3 participants