-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Cannot use 'serverMiddleware' in my nuxt.config when using bridge #585
Comments
It's likely the change in behaviour between connect and h3-shaped server handlers. If you provide a reproduction it may be possible to help further. |
hey @danielroe I'm trying to create a repro. Just a clarification. I can see that nuxt bridge guide instruct to migrate to ESM. Is this mandatory? Will that cause above issue when using bridge? My server code uses commonjs modules extensively and migrating might take time. https://nuxt.com/docs/bridge/overview#migrate-from-commonjs-to-esm |
You should be able to use commonjs dependencies (ie. in node_modules) with no issue. |
Thanks. my server code in /api folder uses commonjs now. should I migrate that? |
@gokatz how did you port |
@yanniznik I am using@vue-storefront/nuxt, and unfortunately it does not provide a migration document. Among them, the section of the servermiddleware, is it successful in the migration? |
Environment
Darwin
v14.18.2
2.16.0-27720022.54e852f
0.5.4
[email protected]
webpack
mode
,target
,head
,css
,plugins
,components
,buildModules
,modules
,pwa
,build
,sentry
,serverMiddleware
,publicRuntimeConfig
,runtimeConfig
,serverHandlers
,devServerHandlers
,bridge
@nuxtjs/[email protected]
,@nuxtjs/[email protected]
()
,@nuxtjs/[email protected]
,@nuxtjs/[email protected]
,@nuxtjs/[email protected]
,@nuxt/[email protected]
Reproduction
Im migrating a medium sized nuxt 2 application to nuxt 3 using bridge. Here is my package.json file and nuxt config for further debugging.
package.json
nuxt.config
Describe the bug
Im trying to follow this one to migrate my nuxt 2 app to nuxt 3: https://v3.nuxtjs.org/bridge/overview My prod build is working fine (havent tested deploying it). But my dev build is not working with a unhelpful error in terminal:
Error
When I remove the
serverMiddleware
from config. The build is working fine, but obviously I cannot use my server.Thanks for any help! This is blocking my nuxt update for while.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: