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

Single layer build instructions possibly broken #16555

Closed
jryans opened this issue Feb 27, 2021 · 10 comments
Closed

Single layer build instructions possibly broken #16555

jryans opened this issue Feb 27, 2021 · 10 comments
Labels
A-Packaging Packaging, signing, releasing P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@jryans
Copy link
Collaborator

jryans commented Feb 27, 2021

Some people are reporting that yarn install followed by yarn dist in the main repo alone (without the other 2 layers) fails with the error:

Module not found: Error: Can't resolve './component-index' in '/home/eiko/Coding/git/element-web/node_modules/matrix-react-sdk/src'

Since this is one of the setup paths we describe in the docs, we should either fix this or remove this path from the docs.

@jryans jryans added T-Defect P2 S-Minor Impairs non-critical functionality or suitable workarounds exist defect A-Packaging Packaging, signing, releasing labels Feb 27, 2021
@jryans jryans added this to Backlog (Unsorted) in Web App Team Feb 27, 2021
@jryans
Copy link
Collaborator Author

jryans commented Feb 27, 2021

Potentially related to #15751, #12771.

@jryans jryans removed the defect label Mar 4, 2021
@jryans
Copy link
Collaborator Author

jryans commented Mar 15, 2021

Hmm, is the root cause that React SDK was published without the component index for some versions?

@BurnyBoi
Copy link

Currently running into this issue on Arch Linux when trying to yarn dist :(

@jryans
Copy link
Collaborator Author

jryans commented Mar 24, 2021

The core issue here is that building from develop means you'll also have develop React SDK, but since you're attempting to operate at the top layer only, React SDK's component index won't exist.

One approach might be to also generate React SDK's component index as well from Element Web's indexing step.

For anyone facing this issue, you should be able to workaround it by running (cd node_modules/matrix-react-sdk; yarn reskindex) before trying to build.

@BurnyBoi

This comment has been minimized.

@SimonBrandner

This comment has been minimized.

@CicadaCinema
Copy link

I was facing this issue today while building element-web from source, on Windows. Not sure if it matters, but I used local versions of matrix-js-sdk and matrix-react-sdk. Here is the log of this build:

PS C:\Users\Atom\Desktop\neo-matrix\element-web> yarn build
yarn run v1.22.5
$ yarn clean && yarn build:genfiles && yarn build:bundle
$ rimraf lib webapp
$ yarn reskindex && yarn build:res && yarn build:jitsi
$ reskindex -h src/header
Reskindex completed
$ node scripts/copy-res.js
$ node scripts/build-jitsi.js
Making webapp directory
Downloading Jitsi script
Done with Jitsi download
$ webpack --progress --bail --mode production
31% building 132/159 modules 27 active ...sktop\neo-matrix\matrix-react-sdk\src\settings\controllers\ThemeController.tsModuleNotFoundError: Module not found: Error: Can't resolve './component-index' in 'C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src'
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\webpack\lib\Compilation.js:925:10
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\webpack\lib\NormalModuleFactory.js:401:22
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\webpack\lib\NormalModuleFactory.js:130:21
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\webpack\lib\NormalModuleFactory.js:224:22
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\neo-async\async.js:2830:7
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\neo-async\async.js:6877:13
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\webpack\lib\NormalModuleFactory.js:214:25
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:213:14
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:44:7
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:67:43
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\RootPlugin.js:37:38
    at _next44 (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:8:1)
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:27:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:67:43
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:16:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\Resolver.js:285:5
    at eval (eval at create (C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\DirectoryExistsPlugin.js:27:15
    at C:\Users\Atom\Desktop\neo-matrix\element-web\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:85:15
resolve './component-index' in 'C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src'
  using description file: C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\package.json (relative path: ./src)
    Field 'matrix_src_browser' doesn't contain a valid alias configuration
    using description file: C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\package.json (relative path: ./src/component-index)
      no extension
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index doesn't exist
      .js
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index.js doesn't exist
      .json
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index.json doesn't exist
      .ts
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index.ts doesn't exist
      .tsx
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index.tsx doesn't exist
      as directory
        C:\Users\Atom\Desktop\neo-matrix\matrix-react-sdk\src\component-index doesn't exist
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The core issue here is that building from develop means you'll also have develop React SDK, but since you're attempting to operate at the top layer only, React SDK's component index won't exist.

One approach might be to also generates React SDK's component index as well from Element Web's indexing step.

For anyone facing this issue, you should be able to workaround it by running (cd node_modules/matrix-react-sdk; yarn reskindex) before trying to build.

Doing the above fixed the problem for me.

CampbellMG added a commit to Qluster-co/qluster-client that referenced this issue Apr 11, 2021
@dkgndianko
Copy link

dkgndianko commented May 27, 2021

The core issue here is that building from develop means you'll also have develop React SDK, but since you're attempting to operate at the top layer only, React SDK's component index won't exist.

One approach might be to also generate React SDK's component index as well from Element Web's indexing step.

For anyone facing this issue, you should be able to workaround it by running (cd node_modules/matrix-react-sdk; yarn reskindex) before trying to build.

I confirm. This solved my issue. But since I was using yarn link to link matrix-react-sdk and matrix-js-sdk, I unlinked them with yarn unlink before doing the suggested solution.

@BurnyBoi
Copy link

BurnyBoi commented Jul 5, 2022

While I don't know that this is the EXACT same issue, the build instructions are broken again for me on latest develop branch today:

$ yarn dist
yarn run v1.22.19
$ scripts/package.sh
$ rimraf lib webapp
$ yarn clean && yarn build:genfiles && yarn build:bundle
$ rimraf lib webapp
$ yarn build:res && yarn build:jitsi && yarn build:module_system
$ node scripts/copy-res.js
$ node scripts/build-jitsi.js
Making webapp directory
Downloading Jitsi script
Done with Jitsi download
$ tsc --project ./tsconfig.module_system.json && node ./lib/module_system/scripts/install.js
$ webpack --progress --bail --mode production
20% building 66/85 modules 19 active /home/user/.local/src/element-web/node_modules/babel-loader/lib/index.js??ref--5!/home/user/.local/src/element-web/src/vector/platform/ElectronPlatform.tsxModuleNotFoundError: Module not found: Error: Can't resolve 'matrix-react-sdk/src/modules/ModuleRunner' in '/home/user/.local/src/element-web/src/vector'
    at /home/user/.local/src/element-web/node_modules/webpack/lib/Compilation.js:925:10
    at /home/user/.local/src/element-web/node_modules/webpack/lib/NormalModuleFactory.js:401:22
    at /home/user/.local/src/element-web/node_modules/webpack/lib/NormalModuleFactory.js:130:21
    at /home/user/.local/src/element-web/node_modules/webpack/lib/NormalModuleFactory.js:224:22
    at /home/user/.local/src/element-web/node_modules/neo-async/async.js:2830:7
    at /home/user/.local/src/element-web/node_modules/neo-async/async.js:6877:13
    at /home/user/.local/src/element-web/node_modules/webpack/lib/NormalModuleFactory.js:214:25
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:213:14
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:43:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:30:40
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/forEachBail.js:30:14
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
    at eval (eval at create (/home/user/.local/src/element-web/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at /home/user/.local/src/element-web/node_modules/enhanced-resolve/lib/Resolver.js:285:5
resolve 'matrix-react-sdk/src/modules/ModuleRunner' in '/home/user/.local/src/element-web/src/vector'
  Parsed request is a module
  using description file: /home/user/.local/src/element-web/package.json (relative path: ./src/vector)
    Field 'matrix_src_browser' doesn't contain a valid alias configuration
    Field 'browser' doesn't contain a valid alias configuration
    resolve as module
      /home/user/.local/src/element-web/src/vector/node_modules doesn't exist or is not a directory
      /home/user/.local/src/element-web/src/node_modules doesn't exist or is not a directory
      /home/user/.local/node_modules doesn't exist or is not a directory
      /home/user/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /home/user/.local/src/element-web/node_modules
        using description file: /home/user/.local/src/element-web/package.json (relative path: ./node_modules)
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
          using description file: /home/user/.local/src/element-web/node_modules/matrix-react-sdk/package.json (relative path: ./src/modules/ModuleRunner)
            no extension
              Field 'matrix_src_browser' doesn't contain a valid alias configuration
              Field 'browser' doesn't contain a valid alias configuration
      looking for modules in /home/user/.local/src/node_modules
        No description file found
        Field 'matrix_src_browser' doesn't contain a valid alias configuration
        Field 'browser' doesn't contain a valid alias configuration
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner doesn't exist
            .js
              Field 'matrix_src_browser' doesn't contain a valid alias configuration
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner.js doesn't exist
            .json
              Field 'matrix_src_browser' doesn't contain a valid alias configuration
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner.json doesn't exist
            .ts
              Field 'matrix_src_browser' doesn't contain a valid alias configuration
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner.ts doesn't exist
            .tsx
              Field 'matrix_src_browser' doesn't contain a valid alias configuration
              Field 'browser' doesn't contain a valid alias configuration
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner.tsx doesn't exist
        No description file found
        no extension
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
            as directory
              /home/user/.local/src/element-web/node_modules/matrix-react-sdk/src/modules/ModuleRunner doesn't exist
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner doesn't exist
        .js
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner.js doesn't exist
        .json
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner.json doesn't exist
        .ts
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner.ts doesn't exist
        .tsx
          Field 'matrix_src_browser' doesn't contain a valid alias configuration
          Field 'browser' doesn't contain a valid alias configuration
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner.tsx doesn't exist
        as directory
          /home/user/.local/src/node_modules/matrix-react-sdk/src/modules/ModuleRunner doesn't exist
error Command failed with exit code 1.

At this point idk if this is just a temporary thing with matrix-react-sdk's develop branch that I should just wait to get sorted out or not. Any info on this latest error would be appreciated.

@t3chguy
Copy link
Member

t3chguy commented Nov 14, 2022

yarn reskindex is now gone, so this should be resolved

@t3chguy t3chguy closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Packaging Packaging, signing, releasing P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

6 participants