unjs / std-env

Runtime Agnostic JS utils
MIT License
459 stars 25 forks source link

Cannot find module `std-env` with `"moduleResolution": "bundler"` tsconfig #50

Closed stafyniaksacha closed 1 year ago

stafyniaksacha commented 1 year ago

Environment

"devDependencies": {
  "nuxt": "^3.4.1",
  "std-env": "^3.3.2"
}

Reproduction

https://stackblitz.com/edit/nuxt-starter-clagn3?file=nuxt.config.ts,tsconfig.json

Describe the bug

std-env package is not resolved when using "moduleResolution": "bundler"

import { isDebug } from 'std-env'
// Cannot find module 'std-env'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?(2792)
{
  // https://v3.nuxtjs.org/concepts/typescript
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "moduleResolution": "bundler"
  }
}

Additional context

No response

Logs

No response

pi0 commented 1 year ago

Hi. This should be fixed in last release. (https://github.com/unjs/std-env/pull/51)