You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was building a package with TypeScript and Webpack, and decided to migrate from 1.x to 4.x and PnP. I did so, and got the following error (trace anonymized) (this error is not from my real project, it's from the MRE below):
$ yarn webpack
C:\Users\pigrammer\project\.pnp.cjs:6919
Error.captureStackTrace(firstError);
^
Error: Your application tried to access import-local, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: import-local
Required by: C:\Users\pigrammer\project\.yarn\__virtual__\webpack-cli-virtual-7ee12da31b\3\AppData\Local\Yarn\Berry\cache\webpack-cli-npm-5.1.4-7be5b53b38-10c0.zip\node_modules\webpack-cli\bin\
Require stack:
- C:\Users\pigrammer\project\.yarn\__virtual__\webpack-cli-virtual-7ee12da31b\3\AppData\Local\Yarn\Berry\cache\webpack-cli-npm-5.1.4-7be5b53b38-10c0.zip\node_modules\webpack-cli\bin\cli.js
- C:\Users\pigrammer\project\.yarn\__virtual__\webpack-virtual-e455d0f00e\3\AppData\Local\Yarn\Berry\cache\webpack-npm-5.91.0-5571fb1057-10c0.zip\node_modules\webpack\bin\webpack.js
at require$$0.Module._resolveFilename (C:\Users\pigrammer\project\.pnp.cjs:6919:13)
at Module._load (node:internal/modules/cjs/loader:985:27)
at require$$0.Module._load (C:\Users\pigrammer\project\.pnp.cjs:6810:31)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (C:\Users\pigrammer\project\.yarn\__virtual__\webpack-cli-virtual-7ee12da31b\3\AppData\Local\Yarn\Berry\cache\webpack-cli-npm-5.1.4-7be5b53b38-10c0.zip\node_modules\webpack-cli\bin\cli.js:5:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at require$$0.Module._extensions..js (C:\Users\pigrammer\project\.pnp.cjs:6962:33)
at Module.load (node:internal/modules/cjs/loader:1207:32)
Node.js v20.10.0
I then ran yarn add --dev import-local
to try to fix this, even though I did not actually use this package. I succeeded in getting a different error:
C:\Users\pigrammer\project\.pnp.cjs:6921
Error.captureStackTrace(firstError);
^
Error: The locator that owns the "/C:/Users/pigrammer/project/Yarn/Berry/cache/import-local-npm-3.1.0-8960af5e51-10c0.zip/node_modules/import-local/" path can't be found inside the dependency tree (this is probably an internal error)
Require stack:
- C:\Users\pigrammer\project\.yarn\__virtual__\webpack-cli-virtual-7ee12da31b\3\AppData\Local\Yarn\Berry\cache\webpack-cli-npm-5.1.4-7be5b53b38-10c0.zip\node_modules\webpack-cli\bin\cli.js
- C:\Users\pigrammer\project\.yarn\__virtual__\webpack-virtual-e455d0f00e\3\AppData\Local\Yarn\Berry\cache\webpack-npm-5.91.0-5571fb1057-10c0.zip\node_modules\webpack\bin\webpack.js
at require$$0.Module._resolveFilename (C:\Users\pigrammer\project\.pnp.cjs:6921:13)
at Module._load (node:internal/modules/cjs/loader:985:27)
at require$$0.Module._load (C:\Users\pigrammer\project\.pnp.cjs:6812:31)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (C:\Users\pigrammer\project\.yarn\__virtual__\webpack-cli-virtual-7ee12da31b\3\AppData\Local\Yarn\Berry\cache\webpack-cli-npm-5.1.4-7be5b53b38-10c0.zip\node_modules\webpack-cli\bin\cli.js:5:21)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at require$$0.Module._extensions..js (C:\Users\pigrammer\project\.pnp.cjs:6964:33)
at Module.load (node:internal/modules/cjs/loader:1207:32)
Node.js v20.10.0
pigrammer3
changed the title
[Bug?]: The locator that owns the path can't be found inside the dependency tree (this is probably an internal error)
[Bug?]: The locator that owns the path can't be found inside the dependency tree (this is probably an internal error) with webpack on Windows
Apr 16, 2024
I am having a similar problem when trying to install electron for a VSCode extension, also on Windows 10:
# This file contains the result of Yarn building a package (electron@npm:32.0.2)
# Script name: postinstall
c:\Users\user\code\my-project\.pnp.cjs:10764
Error.captureStackTrace(firstError);
^
Error: The locator that owns the "/c:/Users/user/AppData/Local/Yarn/Berry/cache/extract-zip-npm-2.0.1-92a28e392b-10c0.zip/node_modules/extract-zip/" path can't be found inside the dependency tree (this is probably an internal error)
Require stack:
- c:\Users\user\code\my-project\.yarn\unplugged\electron-npm-32.0.2-869eb05173\node_modules\electron\install.js
at require$$0.Module._resolveFilename (c:\Users\user\code\my-project\.pnp.cjs:10764:13)
at Module._load (node:internal/modules/cjs/loader:1074:27)
at require$$0.Module._load (c:\Users\user\code\my-project\.pnp.cjs:10655:31)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1339:12)
at require (node:internal/modules/helpers:135:16)
at Object.<anonymous> (c:\Users\user\code\my-project\.yarn\unplugged\electron-npm-32.0.2-869eb05173\node_modules\electron\install.js:9:17)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
Node.js v22.8.0
Self-service
Describe the bug
I was building a package with TypeScript and Webpack, and decided to migrate from 1.x to 4.x and PnP. I did so, and got the following error (trace anonymized) (this error is not from my real project, it's from the MRE below):
I then ran
yarn add --dev import-local
to try to fix this, even though I did not actually use this package. I succeeded in getting a different error:
I would appreciate if this could be fixed.
To reproduce
Package.json:
This happens the same whether I have
webpack.config.js
or whether I don't have it. It occurs even in an empty project with no source files.Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: