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?]: export { POST as GET } is now broken #1659

Open
2 tasks done
samualtnorman opened this issue Oct 23, 2024 · 0 comments
Open
2 tasks done

[Bug?]: export { POST as GET } is now broken #1659

samualtnorman opened this issue Oct 23, 2024 · 0 comments
Labels
bug Something isn't working vinxi related to vinxi

Comments

@samualtnorman
Copy link
Contributor

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

[h3] [unhandled] TypeError: fn2 is not a function
    at eval (/tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/@solidjs+start@1.0.9_solid-js@1.9.3_vinxi@0.4.3_@types+node@22.7.9_ioredis@5.4.1_terser@5.36._4j6ut5gr2pxbf4za75tzgblw4q/node_modules/@solidjs/start/dist/server/handler.js:38:29)
    ... 4 lines matching cause stack trace ...
    at async Server.toNodeHandle (file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:2249:7) {
  cause: TypeError: fn2 is not a function
      at eval (/tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/@solidjs+start@1.0.9_solid-js@1.9.3_vinxi@0.4.3_@types+node@22.7.9_ioredis@5.4.1_terser@5.36._4j6ut5gr2pxbf4za75tzgblw4q/node_modules/@solidjs/start/dist/server/handler.js:38:29)
      at async _callHandler (file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1821:16)
      at async _callHandler (file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1821:16)
      at async file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1962:19
      at async Object.callAsync (file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)
      at async Server.toNodeHandle (file:///tmp/tmp.cE85ExhNff/solid-project/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:2249:7),
  statusCode: 500,
  fatal: false,
  unhandled: true,
  statusMessage: undefined,
  data: undefined
}

Expected behavior 🤔

not throw error

Steps to reproduce 🕹

src/routes/foo.tsx

export function POST() {
	return new Response(`foo`)
}

export { POST as GET }

Try and visit the route.

Context 🔦

Back on SolidStart 0.3 I used to be able to handle both GET and POST requests using the same function using the above code. This is now broken that we've upgraded to 1.0.

Your environment 🌎

System:
    OS: NixOS 24.05.5860.89172919243d (Uakari) x86_64
    CPU: 12th Gen Intel(R) Core(TM) i5-12500 (12) @ 4.60 GHz
Binaries:
    Node: v22.10.0
    PNPM: 9.12.2
npmPackages:
    @solidjs/meta 0.29.4
    @solidjs/router 0.14.10
    @solidjs/start 1.0.9
    solid-js 1.9.3
    vinxi: 0.4.3
@samualtnorman samualtnorman added the bug Something isn't working label Oct 23, 2024
@ryansolid ryansolid added the vinxi related to vinxi label Oct 31, 2024
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

2 participants