unjs / magic-regexp

A compiled-away, type-safe, readable RegExp alternative

Home Page:https://regexp.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No "exports" main defined in ....\.pnpm\magic-regexp@0.6.2\node_modules\estree-walker\package.json

olemarius opened this issue · comments

🐛 The bug

After running pnpm install and adding to vite.config.ts, I got the following error. I'm using vite 4 and pnpm

failed to load config from C:\Git\BlocPlatform\Bloc\Frontend\Bloc.Vue\vite.config.ts
error when starting dev server:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Git\BlocPlatform\Bloc\Frontend\Bloc.Vue\node_modules\.pnpm\magic-regexp@0.6.2\node_modules\estree-walker\package.json
    at new NodeError (node:internal/errors:372:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:472:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:693:7)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Git\BlocPlatform\Bloc\Frontend\Bloc.Vue\node_modules\.pnpm\magic-regexp@0.6.2\node_modules\magic-regexp\dist\transform.cjs:5:22)

 *  The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run dev" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

🛠️ To reproduce

n/a

🌈 Expected behaviour

Expected config to load.

ℹ️ Additional context

No response

Same Issue.

Any updates on this?

Would you try renaming your vite.config file to vite.config.mjs?