-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
The order of entries in project references
make initial build fail or pass
#33947
Comments
--verbose output of failing build:Projects in this build: * packages/ra-tree-ui-materialui/tsconfig.json * packages/ra-core/tsconfig.json * packages/ra-i18n-polyglot/tsconfig.json * packages/ra-ui-materialui/tsconfig.json * packages/react-admin/tsconfig.json * packages/ra-data-fakerest/tsconfig.json * packages/ra-data-graphcool/tsconfig.json * packages/ra-data-graphql/tsconfig.json * packages/ra-data-graphql-simple/tsconfig.json * packages/ra-data-json-server/tsconfig.json * packages/ra-data-simple-rest/tsconfig.json * packages/ra-input-rich-text/tsconfig.json * packages/ra-realtime/tsconfig.json * packages/ra-tree-core/tsconfig.json * tsconfig.json |
--verbose output of passing build:Projects in this build: * packages/ra-core/tsconfig.json * packages/ra-i18n-polyglot/tsconfig.json * packages/ra-ui-materialui/tsconfig.json * packages/react-admin/tsconfig.json * packages/ra-data-fakerest/tsconfig.json * packages/ra-data-graphcool/tsconfig.json * packages/ra-data-graphql/tsconfig.json * packages/ra-data-graphql-simple/tsconfig.json * packages/ra-data-json-server/tsconfig.json * packages/ra-data-simple-rest/tsconfig.json * packages/ra-input-rich-text/tsconfig.json * packages/ra-realtime/tsconfig.json * packages/ra-tree-core/tsconfig.json * packages/ra-tree-ui-materialui/tsconfig.json * tsconfig.json |
This seems to be happening because of shared module resolution cache between projects.. When building `10:39:56 AM - Building project 'c:/temp/react-admin/packages/ra-tree-ui-materialui/tsconfig.json'...` the `ra-core` module is resolved as not present and that information is saved. And error isn't reported because it is from `.js` file without ts-check enabled?``` ======== Resolving module 'ra-core' from 'c:/temp/react-admin/packages/ra-tree-ui-materialui/src/DragPreview.js'. ======== Explicitly specified module resolution kind: 'NodeJs'. Loading module 'ra-core' from 'node_modules' folder, target file type 'TypeScript'. Directory 'c:/temp/react-admin/packages/ra-tree-ui-materialui/src/node_modules' does not exist, skipping all lookups in it. File 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/ra-core.ts' does not exist. File 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/ra-core.tsx' does not exist. File 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/ra-core.d.ts' does not exist. Directory 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/@types' does not exist, skipping all lookups in it. Directory 'c:/temp/react-admin/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at 'c:/temp/react-admin/node_modules/ra-core/package.json'. 'package.json' does not have a 'typesVersions' field. File 'c:/temp/react-admin/node_modules/ra-core.ts' does not exist. File 'c:/temp/react-admin/node_modules/ra-core.tsx' does not exist. File 'c:/temp/react-admin/node_modules/ra-core.d.ts' does not exist. 'package.json' does not have a 'typings' field. 'package.json' does not have a 'types' field. 'package.json' has 'main' field 'lib/index.js' that references 'c:/temp/react-admin/node_modules/ra-core/lib/index.js'. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' does not exist. Loading module as file / folder, candidate module location 'c:/temp/react-admin/node_modules/ra-core/lib/index.js', target file type 'TypeScript'. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js.ts' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js.tsx' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js.d.ts' does not exist. File name 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' has a '.js' extension - stripping it. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.ts' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.tsx' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.d.ts' does not exist. Directory 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' does not exist, skipping all lookups in it. File 'c:/temp/react-admin/node_modules/ra-core/index.ts' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/index.tsx' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/index.d.ts' does not exist. File 'c:/temp/react-admin/node_modules/@types/ra-core.d.ts' does not exist. Directory 'c:/temp/node_modules' does not exist, skipping all lookups in it. Directory 'c:/node_modules' does not exist, skipping all lookups in it. Loading module 'ra-core' from 'node_modules' folder, target file type 'JavaScript'. Directory 'c:/temp/react-admin/packages/ra-tree-ui-materialui/src/node_modules' does not exist, skipping all lookups in it. File 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/ra-core.js' does not exist. File 'c:/temp/react-admin/packages/ra-tree-ui-materialui/node_modules/ra-core.jsx' does not exist. Directory 'c:/temp/react-admin/packages/node_modules' does not exist, skipping all lookups in it. Found 'package.json' at 'c:/temp/react-admin/node_modules/ra-core/package.json'. 'package.json' does not have a 'typesVersions' field. File 'c:/temp/react-admin/node_modules/ra-core.js' does not exist. File 'c:/temp/react-admin/node_modules/ra-core.jsx' does not exist. 'package.json' has 'main' field 'lib/index.js' that references 'c:/temp/react-admin/node_modules/ra-core/lib/index.js'. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' does not exist. Loading module as file / folder, candidate module location 'c:/temp/react-admin/node_modules/ra-core/lib/index.js', target file type 'JavaScript'. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js.js' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js.jsx' does not exist. File name 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' has a '.js' extension - stripping it. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/lib/index.jsx' does not exist. Directory 'c:/temp/react-admin/node_modules/ra-core/lib/index.js' does not exist, skipping all lookups in it. File 'c:/temp/react-admin/node_modules/ra-core/index.js' does not exist. File 'c:/temp/react-admin/node_modules/ra-core/index.jsx' does not exist. Directory 'c:/temp/node_modules' does not exist, skipping all lookups in it. Directory 'c:/node_modules' does not exist, skipping all lookups in it. ======== Module name 'ra-core' was not resolved. ======== ``` Later same resolution is used for
Building again it builds because its not using module resolution cache In short your project references are nor representing real truth of dependencies and because errors are suppressed in some cases you dont see them. |
TBH i'm not sure if i've understand, |
Because |
I've understood my problem |
TypeScript Version: ^3.7.0-dev.20191011
Search Terms: composite project build references
I'm working on making react-admin being built as a composite project WIP PR
I'm making use of allowJS, decelerations, composite
disclaimer: i'm not a maintainer there
On the first build of a project (as in ci without build cache) the build might fail, depends on the order of entries in the
references
entry.With error:
For example, this tsconfig fails with
Cannot find module 'ra-core'
Code
But
pass.
Running the build again making it pass.
Repro (Sorry, its not very minimal)
pull the following branch: https://github.com/Bnaya/react-admin/tree/allowjs-plus-declarations
yarn; yarn cleanup; yarn build-with-composite
Failing CI job:
https://travis-ci.org/marmelab/react-admin/builds/596615134#L588
Passing CI job:
https://travis-ci.org/marmelab/react-admin/builds/596646435
The text was updated successfully, but these errors were encountered: