question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shared context examples not working

See original GitHub issue

i can’t run this example project, error below here.

`lerna info Executing command in 2 packages: “yarn run start” @shared-context/app1: yarn run v1.22.4 @shared-context/app2: yarn run v1.22.4 @shared-context/app1: $ webpack-cli serve @shared-context/app2: $ webpack-cli serve @shared-context/app1: ℹ 「wds」: Project is running at http://localhost:3001/ @shared-context/app1: ℹ 「wds」: webpack output is served from / @shared-context/app1: ℹ 「wds」: Content not from webpack is served from /Users/ots/RepoProject/module-federation-examples-master/shared-context/app1/dist @shared-context/app2: ℹ 「wds」: Project is running at http://localhost:3002/ @shared-context/app2: ℹ 「wds」: webpack output is served from / @shared-context/app2: ℹ 「wds」: Content not from webpack is served from /Users/ots/RepoProject/module-federation-examples-master/shared-context/app2/dist

@shared-context/app1: (node:28924) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. @shared-context/app1: BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.

@shared-context/app1: Do changes to assets earlier, e. g. in Compilation.hooks.processAssets. @shared-context/app1: Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*. @shared-context/app1: ✖ 「wdm」: assets by chunk 972 KiB (id hint: vendors) @shared-context/app1: asset vendors-node_modules_react-dom_index_js.js 909 KiB [emitted] (id hint: vendors) @shared-context/app1: asset vendors-node_modules_react_index_js.js 62.8 KiB [emitted] (id hint: vendors) @shared-context/app1: asset main.js 393 KiB [emitted] (name: main) @shared-context/app1: asset node_modules_object-assign_index_js-node_modules_prop-types_checkPropTypes_js.js 8.22 KiB [emitted]

@shared-context/app1: asset src_bootstrap_js.js 4.19 KiB [emitted] @shared-context/app1: asset index.html 108 bytes [emitted] @shared-context/app1: runtime modules 21.8 KiB 15 modules @shared-context/app1: cacheable modules 1.24 MiB @shared-context/app1: modules by path ./node_modules/ 1.24 MiB 33 modules @shared-context/app1: modules by path ./src/*.js 795 bytes 3 modules @shared-context/app1: consume-shared-module modules 168 bytes @shared-context/app1: consume shared module (default) react@^16.13.1 (strict) (fallback: ./node_modules/react/index.js) 42 bytes [built] [code generated]

@shared-context/app1: consume shared module (default) react-dom@^16.13.1 (strict) (fallback: ./node_modules/react-dom/index.js) 42 bytes [built] [code generated] @shared-context/app1: consume shared module (default) @shared-context/shared-library@* (strict) 42 bytes [built] [code generated]

@shared-context/app1: consume shared module (default) react@^16.14.0 (strict) (fallback: ./node_modules/react/index.js) 42 bytes [built] [code generated]

@shared-context/app1: provide-module modules 84 bytes @shared-context/app1: provide shared module (default) react-dom@16.14.0 = ./node_modules/react-dom/index.js 42 bytes [built] [code generated]

@shared-context/app1: provide shared module (default) react@16.14.0 = ./node_modules/react/index.js 42 bytes [built] [code generated]

@shared-context/app1: ./node_modules/webpack/hot/ sync nonrecursive ^./log$ 170 bytes [built] [code generated] @shared-context/app1: remote app2/Welcome 6 bytes (remote) 6 bytes (share-init) [built] [code generated] @shared-context/app1: external “app2@http://localhost:3002/remoteEntry.js” 42 bytes [built] [code generated] @shared-context/app1: WARNING in shared module @shared-context/shared-library @shared-context/app1: No required version specified and unable to automatically determine one. Unable to find required version for “@shared-context/shared-library” in description file (/Users/ots/RepoProject/module-federation-examples-master/shared-context/app1/package.json). It need to be in dependencies, devDependencies or peerDependencies. @shared-context/app1: ERROR in resolving fallback for shared module @shared-context/shared-library @shared-context/app1: Module not found: Error: Can’t resolve ‘@shared-context/shared-library’ in ‘/Users/ots/RepoProject/module-federation-examples-master/shared-context/app1/src’ @shared-context/app1: webpack 5.18.0 compiled with 1 error and 1 warning in 2758 ms @shared-context/app1: ℹ 「wdm」: Failed to compile. @shared-context/app2: (node:28925) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated. @shared-context/app2: BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation. @shared-context/app2: Do changes to assets earlier, e. g. in Compilation.hooks.processAssets. @shared-context/app2: Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_. @shared-context/app2: ✖ 「wdm」: assets by chunk 1.02 MiB (id hint: vendors) @shared-context/app2: asset vendors-node_modules_react-dom_index_js.js 909 KiB [emitted] (id hint: vendors) @shared-context/app2: asset vendors-shared-library_node_modules_react_index_js.js 70.8 KiB [emitted] (id hint: vendors) @shared-context/app2: asset vendors-node_modules_react_index_js.js 62.8 KiB [emitted] (id hint: vendors) @shared-context/app2: asset main.js 389 KiB [emitted] (name: main) @shared-context/app2: asset remoteEntry.js 27.8 KiB [emitted] (name: app2) @shared-context/app2: asset node_modules_object-assign_index_js-node_modules_prop-types_checkPropTypes_js.js 8.22 KiB [emitted] @shared-context/app2: asset src_bootstrap_js.js 7.08 KiB [emitted] @shared-context/app2: asset src_Welcome_js.js 2.22 KiB [emitted] @shared-context/app2: asset index.html 129 bytes [emitted] @shared-context/app2: runtime modules 38.4 KiB 25 modules @shared-context/app2: cacheable modules 1.31 MiB @shared-context/app2: modules by path ./node_modules/ 1.24 MiB 33 modules @shared-context/app2: modules by path …/shared-library/ 65.6 KiB 7 modules @shared-context/app2: modules by path ./src/.js 945 bytes 4 modules @shared-context/app2: consume-shared-module modules 210 bytes 5 modules @shared-context/app2: provide-module modules 126 bytes @shared-context/app2: provide shared module (default) react-dom@16.14.0 = ./node_modules/react-dom/index.js 42 bytes [built] [code generated] @shared-context/app2: provide shared module (default) react@16.14.0 = ./node_modules/react/index.js 42 bytes [built] [code generated] @shared-context/app2: provide shared module (default) react@16.14.0 = …/shared-library/node_modules/react/index.js 42 bytes [built] [code generated] @shared-context/app2: container entry 42 bytes [built] [code generated] @shared-context/app2: ./node_modules/webpack/hot/ sync nonrecursive ^./log$ 170 bytes [built] [code generated] @shared-context/app2: WARNING in shared module @shared-context/shared-library @shared-context/app2: No required version specified and unable to automatically determine one. Unable to find required version for “@shared-context/shared-library” in description file (/Users/ots/RepoProject/module-federation-examples-master/shared-context/app2/package.json). It need to be in dependencies, devDependencies or peerDependencies. @shared-context/app2: ERROR in resolving fallback for shared module @shared-context/shared-library @shared-context/app2: Module not found: Error: Can’t resolve ‘@shared-context/shared-library’ in ‘/Users/ots/RepoProject/module-federation-examples-master/shared-context/app2/src’ @shared-context/app2: webpack 5.18.0 compiled with 1 error and 1 warning in 3035 ms @shared-context/app2: ℹ 「wdm」: Failed to compile.`

any one can help me please?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
daskyrkcommented, Mar 10, 2021

same problem. I think share ‘@shared-context/shared-library’ like the demo is impossible, webpack cannot resolve the library without any other config file but just a string. maybe the demo means after publish ‘@shared-context/shared-library’ to registry, and share it like a normal library.

1reaction
ScriptedAlchemycommented, Jun 29, 2021

We call it rexpoets. Basically you create a file that import exports whatever you manually shake.

No automatic solution though

Read more comments on GitHub >

github_iconTop Results From Across the Web

shared context - Example groups - RSpec Core - Relish
Use shared_context to define a block that will be evaluated in the context of example groups either locally, using include_context in an example...
Read more >
Cannot get shared_contexts to work in rspec 3.9.0 / rspec-rails 4
I have verified my file in spec/support is being loaded, but for whatever reason, lets/methods defined are not available in the example group ......
Read more >
Why is shared context so critical? Just ask Einstein! - LinkedIn
Without shared context little can be achieved​​ As Einstein says, the problem is that people simply don't understand what they are working on ......
Read more >
Be able to navigate to shared context (and shared examples ...
What steps will reproduce the problem? demonstrate the needed feature. Given a project with rspec and I have a spec which uses a...
Read more >
Context - React
Context provides a way to share values like these between components ... The way changes are determined can cause some issues when passing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found