Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to resolve entry for package "matrix-js-sdk" #3013

Closed
kfiven opened this issue Dec 31, 2022 · 4 comments · Fixed by #3051
Closed

Failed to resolve entry for package "matrix-js-sdk" #3013

kfiven opened this issue Dec 31, 2022 · 4 comments · Fixed by #3051
Assignees

Comments

@kfiven
Copy link

kfiven commented Dec 31, 2022

When trying to start a dev server or build app, my build system reports:

[commonjs--resolver] Failed to resolve entry for package "matrix-js-sdk". The package may have incorrect main/module/exports specified in its package.json.
error during build:
Error: Failed to resolve entry for package "matrix-js-sdk". The package may have incorrect main/module/exports specified in its package.json.
    at packageEntryFailure (file:///home/runner/work/cinny/cinny/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:22938:11)
    at resolvePackageEntry (file:///home/runner/work/cinny/cinny/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:22935:5)
    at tryNodeResolve (file:///home/runner/work/cinny/cinny/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:22671:[20](https://github.com/cinnyapp/cinny/actions/runs/3783229035/jobs/6431607704#step:5:21))
    at Object.resolveId (file:///home/runner/work/cinny/cinny/node_modules/vite/dist/node/chunks/dep-2285ba4f.js:22435:28)
    at file:///home/runner/work/cinny/cinny/node_modules/rollup/dist/es/shared/rollup.js:23451:40
Error: Process completed with exit code 1.

Started happening with sdk version 23.0.0
node: v18.12.1
yarn: 1.22.19
npm: 8.19.2

@ankit-pn
Copy link
Contributor

ankit-pn commented Jan 2, 2023

Can you specify in more detail how to reproduce this issue? because this is working fine for me!

@kfiven
Copy link
Author

kfiven commented Jan 2, 2023

@davidisaaclee
Copy link
Contributor

@kfiven I think this could be related to #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?

@MTRNord
Copy link
Contributor

MTRNord commented Jan 4, 2023

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.

@t3chguy t3chguy self-assigned this Jan 11, 2023
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Jan 19, 2023
* Remove extensible events v1 field population on legacy events ([\matrix-org#3040](matrix-org#3040)).
* Improve hasUserReadEvent and getUserReadUpTo realibility with threads ([\matrix-org#3031](matrix-org#3031)). Fixes element-hq/element-web#24164.
* Remove video track when muting video ([\matrix-org#3028](matrix-org#3028)). Fixes element-hq/element-call#209.
* Make poll start event type available (PSG-962) ([\matrix-org#3034](matrix-org#3034)).
* Add alt event type matching in Relations model ([\matrix-org#3018](matrix-org#3018)).
* Remove usage of v1 Identity Server API ([\matrix-org#3003](matrix-org#3003)).
* Add `device_id` to `/account/whoami` types ([\matrix-org#3005](matrix-org#3005)).
* Implement MSC3912: Relation-based redactions ([\matrix-org#2954](matrix-org#2954)).
* Introduce a mechanism for using the rust-crypto-sdk ([\matrix-org#2969](matrix-org#2969)).
* Support MSC3391: Account data deletion ([\matrix-org#2967](matrix-org#2967)).
* Fix threaded cache receipt when event holds multiple receipts ([\matrix-org#3026](matrix-org#3026)).
* Fix false key requests after verifying new device ([\matrix-org#3029](matrix-org#3029)). Fixes element-hq/element-web#24167 and element-hq/element-web#23333.
* Avoid triggering decryption errors when decrypting redacted events ([\matrix-org#3004](matrix-org#3004)). Fixes element-hq/element-web#24084.
* bugfix: upload OTKs in sliding sync mode ([\matrix-org#3008](matrix-org#3008)).
* Apply edits discovered from sync after thread is initialised ([\matrix-org#3002](matrix-org#3002)). Fixes element-hq/element-web#23921.
* Sliding sync: Fix issue where no unsubs are sent when switching rooms ([\matrix-org#2991](matrix-org#2991)).
* Threads are missing from the timeline ([\matrix-org#2996](matrix-org#2996)). Fixes element-hq/element-web#24036.
* Close all streams when a call ends ([\matrix-org#2992](matrix-org#2992)). Fixes element-hq/element-call#742.
* Resume to-device message queue after resumed sync ([\matrix-org#2920](matrix-org#2920)). Fixes matrix-org/element-web-rageshakes#17170.
* Fix browser entrypoint ([\matrix-org#3051](matrix-org#3051)). Fixes matrix-org#3013.
* Fix failure to start in firefox private browser ([\matrix-org#3058](matrix-org#3058)). Fixes element-hq/element-web#24216.
* Correctly handle limited sync responses by resetting the thread timeline ([\matrix-org#3056](matrix-org#3056)). Fixes element-hq/element-web#23952.
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Feb 1, 2023
* Implement decryption via the rust sdk ([\matrix-org#3074](matrix-org#3074)).
* Handle edits which are bundled with an event, per MSC3925 ([\matrix-org#3045](matrix-org#3045)).
* Add null check for our own member event ([\matrix-org#3082](matrix-org#3082)).
* Handle group call getting initialised twice in quick succession ([\matrix-org#3078](matrix-org#3078)). Fixes element-hq/element-call#847.
* Correctly handle limited sync responses by resetting the thread timeline ([\matrix-org#3056](matrix-org#3056)). Fixes element-hq/element-web#23952. Contributed by @justjanne.
* Fix failure to start in firefox private browser ([\matrix-org#3058](matrix-org#3058)). Fixes element-hq/element-web#24216.
* Fix spurious "Decryption key withheld" messages ([\matrix-org#3061](matrix-org#3061)). Fixes element-hq/element-web#23803.
* Fix browser entrypoint ([\matrix-org#3051](matrix-org#3051)). Fixes matrix-org#3013.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants