Fix issue using pnpm start#33518
Draft
rbondesson wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue below, but I not confident that it won't impact any other builds etc.
To reproduce the issue:
1 - Nuke node_modules folders
2 - pnpm install
3 - Go to app/web and do pnpm start
Changes:
shared-components: Vite now emits element-web-shared-components.css directly, removing the rename race that made webpack miss the file.
module-api: the watch build now also writes element-web-module-api-alpha.d.ts, matching the package’s declared types path.
Command line output showing the error:
xyz@xyz:[element-web-folder]$ pnpm start
vite v8.0.10 building client environment for production...
watching for file changes...
build started...
✓ 52 modules transformed.
[unplugin:dts] Start generate declaration files...
[unplugin:dts] Declaration files built in 3019ms.
computing gzip size...
lib/element-web-plugin-engine.js 34.47 kB │ gzip: 9.10 kB │ map: 115.51 kB
built in 3169ms.
build started...
✓ 52 modules transformed.
computing gzip size...
lib/element-web-plugin-engine.umd.cjs 26.81 kB │ gzip: 8.28 kB │ map: 115.03 kB
built in 179ms.
vite v8.0.10 building client environment for production...
watching for file changes...
build started...
src/core/i18n/I18nApi.ts:14:8 - error TS7016: Could not find a declaration file for module '@element-hq/element-web-module-api'. '[element-web-folder]/packages/module-api/lib/element-web-plugin-engine.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/element-hq__element-web-module-apiif it exists or add a new declaration (.d.ts) file containingdeclare module '@element-hq/element-web-module-api';14 } from "@element-hq/element-web-module-api";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/i18n/i18nContext.ts:9:30 - error TS7016: Could not find a declaration file for module '@element-hq/element-web-module-api'. '[element-web-folder]/packages/module-api/lib/element-web-plugin-engine.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/element-hq__element-web-module-apiif it exists or add a new declaration (.d.ts) file containingdeclare module '@element-hq/element-web-module-api';9 import { type I18nApi } from "@element-hq/element-web-module-api";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/utils/humanize.ts:9:30 - error TS7016: Could not find a declaration file for module '@element-hq/element-web-module-api'. '[element-web-folder]/packages/module-api/lib/element-web-plugin-engine.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/element-hq__element-web-module-apiif it exists or add a new declaration (.d.ts) file containingdeclare module '@element-hq/element-web-module-api';9 import { type I18nApi } from "@element-hq/element-web-module-api";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/viewmodel/Disposables.ts:54:20 - error TS2345: Argument of type 'string | symbol' is not assignable to parameter of type 'string | number'.
Type 'symbol' is not assignable to type 'string | number'.
54 emitter.on(event, callback);
~~~~~
src/core/viewmodel/Disposables.ts:56:25 - error TS2345: Argument of type 'string | symbol' is not assignable to parameter of type 'string | number'.
Type 'symbol' is not assignable to type 'string | number'.
56 emitter.off(event, callback);
~~~~~
src/room/timeline/event-tile/body/DecryptionFailureBodyView/DecryptionFailureBodyView.tsx:11:30 - error TS7016: Could not find a declaration file for module '@element-hq/element-web-module-api'. '[element-web-folder]/packages/module-api/lib/element-web-plugin-engine.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/element-hq__element-web-module-apiif it exists or add a new declaration (.d.ts) file containingdeclare module '@element-hq/element-web-module-api';11 import { type I18nApi } from "@element-hq/element-web-module-api";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/room/timeline/event-tile/body/MjolnirBodyView/MjolnirBodyView.tsx:55:29 - error TS7006: Parameter 'sub' implicitly has an 'any' type.
55 a: (sub) => (
~~~
✓ 1225 modules transformed.
[unplugin:dts] Start generate declaration files...
[unplugin:dts] Start bundling declaration files...
Analysis will use the bundled TypeScript version 5.9.3
*** The target project appears to use TypeScript 6.0.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
Analysis will use the bundled TypeScript version 5.9.3
*** The target project appears to use TypeScript 6.0.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
[unplugin:dts] Declaration files built in 34578ms.
computing gzip size...
dist/web-shared-components.css 77.18 kB │ gzip: 13.49 kB
dist/numbers.js 0.46 kB │ gzip: 0.26 kB
dist/element-web-shared-components.js 650.79 kB │ gzip: 179.64 kB
built in 35952ms.
build started...
✓ 1224 modules transformed.
computing gzip size...
dist/web-shared-components.css 77.18 kB │ gzip: 13.49 kB
dist/numbers.umd.cjs 0.47 kB │ gzip: 0.29 kB
dist/element-web-shared-components.umd.cjs 502.81 kB │ gzip: 162.07 kB
built in 1821ms.
◇ injected env (0) from .env // tip: ⌘ suppress logs { quiet: true }
[webpack-dev-server] Project is running at:
[webpack-dev-server] Loopback: http://localhost:8080/, http://[::1]:8080/
[webpack-dev-server] On Your Network (IPv4): http://172.27.172.192:8080/
[webpack-dev-server] Content not from webpack is served from './webapp' directory
[webpack-dev-middleware] wait until bundle finished: /
[webpack-dev-middleware] ModuleNotFoundError: Module not found: Error: Can't resolve '@element-hq/web-shared-components/dist/element-web-shared-components.css' in '[element-web-folder]/apps/web/src/vector'
at [element-web-folder]/node_modules/webpack/lib/Compilation.js:2143:28
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:1076:13
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :10:1)
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:456:22
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :9:1)
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:642:22
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:193:10
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:917:25
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:1162:8
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:1292:5
at [element-web-folder]/node_modules/neo-async/async.js:6883:13
at [element-web-folder]/node_modules/webpack/lib/NormalModuleFactory.js:1275:45
at finishWithoutResolve ([element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:590:11)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:679:14
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :16:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :27:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:89:43
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :16:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/forEachBail.js:39:13
at [element-web-folder]/node_modules/enhanced-resolve/lib/AliasUtils.js:166:11
at next ([element-web-folder]/node_modules/enhanced-resolve/lib/forEachBail.js:35:3)
at forEachBail ([element-web-folder]/node_modules/enhanced-resolve/lib/forEachBail.js:49:9)
at aliasResolveHandler ([element-web-folder]/node_modules/enhanced-resolve/lib/AliasUtils.js:62:2)
at [element-web-folder]/node_modules/enhanced-resolve/lib/AliasPlugin.js:37:5
at _next0 (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :8:1)
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :30:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :16:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :16:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :27:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:89:43
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :16:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/Resolver.js:740:5
at eval (eval at create ([element-web-folder]/node_modules/tapable/lib/HookCodeFactory.js:31:10), :15:1)
at [element-web-folder]/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:43:15
at process.processTicksAndRejections (node:internal/process/task_queues:89:21)
resolve '@element-hq/web-shared-components/dist/element-web-shared-components.css' in '[element-web-folder]/apps/web/src/vector'
Parsed request is a module
using description file: [element-web-folder]/apps/web/package.json (relative path: ./src/vector)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
[element-web-folder]/apps/web/src/vector/node_modules doesn't exist or is not a directory
[element-web-folder]/apps/web/src/node_modules doesn't exist or is not a directory
looking for modules in [element-web-folder]/apps/web/node_modules
existing directory [element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components
using description file: [element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/package.json (relative path: .)
using exports field: ./dist/element-web-shared-components.css
using description file: [element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/package.json (relative path: ./dist/element-web-shared-components.css)
no extension
Field 'browser' doesn't contain a valid alias configuration
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css.json doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css.ts doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css.tsx doesn't exist
as directory
[element-web-folder]/apps/web/node_modules/@element-hq/web-shared-components/dist/element-web-shared-components.css doesn't exist
[element-web-folder]/apps/node_modules doesn't exist or is not a directory
looking for modules in [element-web-folder]/node_modules
[element-web-folder]/node_modules/@element-hq/web-shared-components doesn't exist
/home/xyz/xyz/xyz/node_modules doesn't exist or is not a directory
/home/xyz/xyz/node_modules doesn't exist or is not a directory
/home/xyz/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
———————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Cancelled running target start for project element-web (1m)
ELIFECYCLE Command failed with exit code 130.