-
Notifications
You must be signed in to change notification settings - Fork 31
[bug] Cannot resolve std-env in nitro v3 #122
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
The nitro (v3) plugin imports from nitro/runtime-config.
Usage of evlog fails in a nitro (v3) project as evlog is treated as external by Nitro's bundler. This means nitro/runtime-config is not transformed by Nitro but delegated to the runtime (Node/Bun/Deno) to resolve.
At runtime, the import resolves to Nitro's stub implementation which imports std-env - a package that is not installed.
Fix is to add evlog to Nitro's noExternal option. This forces Nitro to bundle evlog and properly transform the nitro/runtime-config import.
Reproduction
- Create a new nitro v3 project
- Install evlog
- Register evlog plugin
- Run dev
- See error
Logs
Worker error: Cannot find package 'std-env' imported from /node_modules/nitro/dist/runtime/virtual/_runtime_warn.mjs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working