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

Docs example fail ❌: https://v3.nuxtjs.org/examples/experimental/wasm/ #15389

Closed
chinanf-boy opened this issue Nov 7, 2022 · 4 comments · Fixed by nuxt/framework#8767
Closed

Comments

@chinanf-boy
Copy link

Environment

Chrome

https://v3.nuxtjs.org/examples/experimental/wasm/

Reproduction

Describe the bug

SyntaxError: The requested module 'file:///home/projects/llqilqgoa.github/node_modules/h3/dist/index.mjs' does not provide an export named 'defineLazyHandler'
at async Promise.all (index 0)

Additional context

Fix

https://github.com/nuxt/framework/blob/main/examples/experimental/wasm/server/api/sum.ts#L1

import { defineLazyHandler } from 'h3'

export default defineLazyHandler(async () => {

defineLazyHandler => lazyEventHandler

import { lazyEventHandler } from 'h3'

export default lazyEventHandler(async () => {

Done

Logs

No response

@manniL
Copy link
Member

manniL commented Nov 7, 2022

PR Welcome ☺️

@manniL
Copy link
Member

manniL commented Nov 7, 2022

It is weird though because defineLazyEventHandler should exist 🤔

@suruaku
Copy link
Contributor

suruaku commented Nov 7, 2022

Isn't your link to defineLazyEventHandler not defineLazyHandler?

defineLazyHandler is not in the code base anymore, see this:

https://github.com/unjs/h3/search?q=defineLazyHandler

There's also a link in the issue to the place where the change was made.
defineLazyHandler => lazyEventHandler

Now when I read the change and docs more closely I think defineLazyEventHandler is more appropriate than lazyEventHandler. Not 100% sure, tho.

@manniL
Copy link
Member

manniL commented Nov 7, 2022

Yes, my bad. I mean defineLazyEventHandler and it should be preferred ☺️

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants