Closed kfiven closed 1 year ago
Can you specify in more detail how to reproduce this issue? because this is working fine for me!
Clone https://github.com/cinnyapp/cinny/tree/dependabot/npm_and_yarn/matrix-js-sdk-23.0.0 and then
npm ci
npm start
@kfiven I think this could be related to https://github.com/matrix-org/matrix-js-sdk/issues/3015 – specifically, that matrix-js-sdk's package.json#browser is set to ./lib/browser-index.ts, which afaict is not an existent file.
I have steps in that issue for how I fixed this for create-react-app / Webpack 5; maybe they'd work for you as well?
This seems to also break vitejs:
✘ [ERROR] [plugin vite:dep-scan] Failed to resolve entry for package "matrix-js-sdk". The package may have incorrect main/module/exports specified in its package.json.
node_modules/esbuild/lib/main.js:1357:21:
1357 │ let result = await callback({
╵ ^
at packageEntryFailure (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:21837:11)
at resolvePackageEntry (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:21834:5)
at tryNodeResolve (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:21572:20)
at Context.resolveId (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:21336:28)
at Object.resolveId (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41433:46)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async resolve (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41661:26)
at async file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41835:34
at async requestCallbacks.on-resolve (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:1357:22)
at async handleRequest (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:723:13)
This error came from the "onResolve" callback registered here:
node_modules/esbuild/lib/main.js:1281:20:
1281 │ let promise = setup({
╵ ^
at setup (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41825:19)
at handlePlugins (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:1281:21)
at buildOrServeImpl (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:970:5)
at Object.buildOrServe (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:776:5)
at /var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:2117:17
at new Promise (<anonymous>)
at Object.build (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:2116:14)
at build (/var/home/marcel/projects/matrix-art/node_modules/esbuild/lib/main.js:1963:51)
at scanImports (file:///var/home/marcel/projects/matrix-art/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:41606:11)
The plugin "vite:dep-scan" was triggered by this import
src/matrix/client.ts:15:7:
15 │ } from 'matrix-js-sdk';
╵ ~~~~~~~~~~~~~~~
Build failed with 1 error:
node_modules/esbuild/lib/main.js:1357:21: ERROR: [plugin: vite:dep-scan] Failed to resolve entry for package "matrix-js-sdk". The package may have incorrect main/module/exports specified in its package.json.
When trying to start a dev server or build app, my build system reports:
Started happening with sdk version 23.0.0 node: v18.12.1 yarn: 1.22.19 npm: 8.19.2