encoredev / encore

Open Source Development Platform for building robust type-safe distributed systems with declarative infrastructure
https://encore.dev
Mozilla Public License 2.0
7.85k stars 335 forks source link

Failing `encore run` - missing PnP support #1613

Open rtritto opened 2 days ago

rtritto commented 2 days ago

Reproduction

repository=repro-encore-win ~ branch=start-server

  • iwr https://encore.dev/install.ps1 | iex
  • git clone https://github.com/rtritto/repro-encore-win.git
  • cd repro-encore-win
  • git checkout start-server
  • yarn
  • encore run
    
    ⠋ Building Encore application graph...
    ⠋ Analyzing service topology...
    setup deps

Caused by: 0: setup dependencies 1: yarn install failed 2: program not found

Stack backtrace: 0: anyhow::backtrace::capture::Backtrace::capture 1: ::setup_deps 2: scoped_tls::ScopedKey::set 3: tsparser_encore::main 4: std::sys_common::backtrace::__rust_begin_short_backtrace 5: main 6: __tmainCRTStartup 7: mainCRTStartup 8: 9:

- `.yarnrc.yml` is updated:
  ```diff
  -nodeLinker: pnp
  +nodeLinker: node-modules
  -
  plugins:
  -  - checksum: 5e73a1acbb9741fce1e8335e243c9480ea2107b9b4b65ed7643785ddea9e3019aee254a92a853b1cd71023b16fff5b7d3afd5256fe57cd35a54f8785b8c30281
  -    path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
  -    spec: "https://github.com/mskelton/yarn-plugin-outdated/raw/v4.0.1/bundles/@yarnpkg/plugin-outdated.js"
  -  - checksum: 7930a64ba6239d4502df0204edda913788df1a9614a9056d23b53345d844f6f13526dae71c2be5282071502c3c077db7b1e97bcf019037db3ca35c737cd25b0c
  -    path: .yarn/plugins/plugin-dedupe-on-install.cjs
  -    spec: "https://raw.githubusercontent.com/ambar/yarn-plugin-dedupe-on-install/main/index.js"
  +- checksum: 5e73a1acbb9741fce1e8335e243c9480ea2107b9b4b65ed7643785ddea9e3019aee254a92a853b1cd71023b16fff5b7d3afd5256fe57cd35a54f8785b8c30281
  +  path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
  +  spec: https://github.com/mskelton/yarn-plugin-outdated/raw/v4.0.1/bundles/@yarnpkg/plugin-outdated.js
  +- checksum: 7930a64ba6239d4502df0204edda913788df1a9614a9056d23b53345d844f6f13526dae71c2be5282071502c3c077db7b1e97bcf019037db3ca35c737cd25b0c
  +  path: .yarn/plugins/plugin-dedupe-on-install.cjs
  +  spec: https://raw.githubusercontent.com/ambar/yarn-plugin-dedupe-on-install/main/index.js

  yarnPath: .yarn/releases/yarn-4.5.3.cjs

Info

OS: Windows 11 Node: v22 encore.dev: v1.44.6 (same behavior with v1.44.5) encode installed v1.44.5 yarn berry with PnP (Plug'n'Play)

eandre commented 2 days ago

Encore's dependency resolver currently requires node_modules. We have looked into supporting pnp but it's not a high priority at the moment. Last time I looked the format is not very well documented so building tooling to support it is relatively difficult.

rtritto commented 2 days ago

FYI @arcanis @merceyz

eandre commented 2 days ago

Or are you saying you are using yarn's node_modules mode? That should definitely work.

rtritto commented 2 days ago

Or are you saying you are using yarn's node_modules mode? That should definitely work.

No, I'm using Plug'n'Play instead of _nodemodules:

.yarnrc.yml

nodeLinker: pnp
rtritto commented 2 days ago

Maybe encore.exe point to C:\Users\<USER>\.encore\runtimes\js\encore.dev\package.json instead of package.json of the project (where I run encore run and where there is encore.app file).

Why encore.dev dependency is duplicated in C:\Users\<USER>\.encore\runtimes\js? encore.dev dependency is already installed in the project (package.json).