$ npm ls
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected]
As you can see there are 2 major versions of test-webcomponent
.
- build step via polyserv to translate bare module specifier to relative path
IS:
Page Feature A+B gives error in browser
DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry
SHOULD BE: Error during install? => package name map could solve it? => let's try Setup 2
npm install --only=production
npm run start:noShim
- Open http://127.0.0.1:8081/components/build-pnm-webcomponent-issue/
- Feature A, Feature B works
- Feature A+B gives error
- yarn plug'n'play
- generate package-name-maps (via build-pnm)
- shim package-name-maps (via es-module-shims)
IS:
Page Feature A+B gives error in browser
DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry
SHOULD BE: Error/Question while creating package name map.
Possible example flow:
Could not find a sadisfying version for 'test-webcomponent'. Which one would you like to use in your package name map?
> v1.0.0 (required by [email protected])
v2.0.0 (required by [email protected])
yarn install
yarn start
- Open http://127.0.0.1:8080
- Feature A, Feature B works
- Feature A+B gives error