-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix mount @c8y/client dual package hazard #84
Comments
Started enabling eslint and typescript refactoring in #83 to prepare possible split of plugin and lib. |
When building with
There seems to be no fix / workaround for this to be working. |
Fixed by #85. Using rollup, the plugin is now prepared to work with Cypress from es2020 build. |
…l-package-hazard #84: Fix loading plugin in Cypress with es2020
The
mount
command does register a provider forFetchClient
. In the current configuration, typescript generates theFetchClient
import inmount.ts
asrequire()
,ngx-components
however importsFetchClient
withimport from
resulting in a so called "dual package hazard".@c8y/client
is provided as a single source npm module with differentcjs
andesm
exports. This results inmount
withrequire
andngx-components
withimport
loading 2 different instances. With this, theFetchClient
provider registered bymount
is not used.See Node.js Dual Package Hazard doc and Cypress Typescript doc
As a workaround
mount
is currently implemented as javascript, which is considered a workaround only and should be fixed. Changing typescript configuration results in error loading the plugin in Cypress node runtime. This might require to split plugin and commands to enable different build settings.Related Cypress issues:
See here for guide on creating single source npm modules.
The text was updated successfully, but these errors were encountered: