Next.js can't be built when importing `Resource` from middleware
brapifra opened this issue · comments
Brais Piñeiro commented
Steps to reproduce:
- Set up basic next.js deployment
- Add a
middleware.ts
file, importResource
fromsst
and try to use it (e.g.Resource.MySecret.value
)
Error
Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Import trace for requested module:
node:process
./node_modules/.pnpm/sst@3.0.32_hono@4.4.0/node_modules/sst/dist/resource.js
./node_modules/.pnpm/sst@3.0.32_hono@4.4.0/node_modules/sst/dist/index.js
SST version: 0.0.403
Dax commented
can you try using 3.0.33 of the sst package?
Brais Piñeiro commented
It works with 3.0.33 🥳 Thanks!