sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 126 forks source link

Next.js can't be built when importing `Resource` from middleware #529

Closed brapifra closed 2 weeks ago

brapifra commented 3 weeks ago

Steps to reproduce:

  1. Set up basic next.js deployment
  2. Add a middleware.ts file, import Resource from sst 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

thdxr commented 2 weeks ago

can you try using 3.0.33 of the sst package?

brapifra commented 2 weeks ago

It works with 3.0.33 🥳 Thanks!