Closed thomaswinkler closed 7 months ago
Started enabling eslint and typescript refactoring in #83 to prepare possible split of plugin and lib.
When building with es2020
module setting, the plugin does not load with the following error. See linked Cypress issues in the description.
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for .../digital-twin-manager/cypress.config.ts
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.
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.