teambit / bit

A build system for development of composable software.
https://bit.dev
Other
17.82k stars 924 forks source link

Angular v12 - `bbit start`: Invalid configuration object. #4875

Closed mryraghi closed 3 years ago

mryraghi commented 3 years ago

Describe the bug

After following the guide at this link and therefore:

the terminal gets stuck and throws this error:

** unhandled rejection found, please make sure the promise is resolved/rejected correctly! **
Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property '_assetEmittingPreviousFiles'. These properties are valid:
   object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }
This error should have never happened. Please report this issue on Github https://github.com/teambit/bit/issues
Building UI assets for 'angular-workspace' in target directory: public/bit. The first time we build the UI it may take a few minutes.
ENVIRONMENT NAME                                              URL                                                            STATUS
teambit.angular/angular-v12@0.0.29                            http://localhost:3300                                          RUNNING

You can now view 'angular-workspace' components in the browser.
Bit server is running on http://localhost:3000
⠴ Generating browser application bundles (phase: setup)...

After a minute or so the dev server seems to be running and successfully launches localhost:3000 with the test ui/my-button component and no apparent errors shown next to its name (on the left sidebar). Nevertheless, when you click on it and try to browse Overview, Composition, etc nothing is shown (i.e. white tabs).

Steps to Reproduce

  1. Git clone this repo to reproduce
  2. bbit install
  3. bbit compile
  4. bbit start

Expected Behavior

To run and start the dev server correctly.

Specifications

Additional context

You can find a repo with the exact code at this link.

mryraghi commented 3 years ago

Side note, I tried to tag and export nevertheless, and it seems to work when run on bit.dev (check out this link). Am I missing something?

ocombe commented 3 years ago

Hello, this is because of the update of webpack dev-server in bit core, the schema for bit-angular webpack config needs to be updated, I will release a new version shortly with the fix. The error is only for the dev server, that's why it works on bit.dev where we use the prod build

mryraghi commented 3 years ago

Thank you for your prompt reply and fixe @ocombe, much appreciated!

You fix does indeed solves the issue, allowing me to work on my components. Nevertheless, I see a warning appearing in the console (that doesn't seem to disrupt my work but it's worth notifying you):

Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "."
InvalidDependenciesModuleWarning: Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "."
    at handleBuildDone (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:980:7)
    at handleParseResult (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:936:12)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:1026:4
    at processResult (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:743:11)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:807:5
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:406:3
    at iterateNormalLoaders (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:232:10)
    at iterateNormalLoaders (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:239:10)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:254:3
    at context.callback (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/babel-loader@8.2.2_1ef96c0ff5bf278057a4bc2ae1f672a2/node_modules/babel-loader/lib/index.js:59:71
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at processImmediate (internal/timers.js:434:9)

Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "."
InvalidDependenciesModuleWarning: Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "."
    at handleBuildDone (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:980:7)
    at handleParseResult (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:936:12)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:1026:4
    at processResult (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:743:11)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/webpack@5.40.0/node_modules/webpack/lib/NormalModule.js:807:5
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:406:3
    at iterateNormalLoaders (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:232:10)
    at iterateNormalLoaders (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:239:10)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:254:3
    at context.callback (/Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/loader-runner@4.2.0/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at /Users/romeo/Library/Caches/Bit/capsules/c7063058f72c9c70fa4ef020eed2755adf1170d8/node_modules/.pnpm/registry.npmjs.org/babel-loader@8.2.2_1ef96c0ff5bf278057a4bc2ae1f672a2/node_modules/babel-loader/lib/index.js:59:71
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at processImmediate (internal/timers.js:434:9)

Cheers!

mryraghi commented 3 years ago

Also the docs should be updated to reflect this commit