Describe the bug
ember-cli-clipboard cannot be used in an app build with Vite.
The following error is thrown:
Uncaught TypeError: window.require is not a function
The error is caused by ember-get-config, which relies on require here: https://github.com/mansona/ember-get-config/blob/552ce14df18a68481f4a8bb8528fa7b95e75b5e9/addon/index.js#L6
ember-cli-clipboard pulls in ember-get-config through its dependency on ember-arg-type:
$ pnpm why ember-get-config
devDependencies:
ember-cli-clipboard 1.3.0
└─┬ ember-arg-types 1.1.0
└── ember-get-config 2.1.1
To Reproduce
I haven't tested this reproduction myself. But I assume it can be reproduced in any newly created app with Ember CLI v6.8 when adding ember-cli-clipboard to it.
Expected behavior
An app using ember-cli-clipboard can be built with Vite.
Additional context
I see 3 options:
- Improve
ember-get-config to not rely on require anymore.
- Refactor
ember-arg-types to not depend on ember-get-config anymore.
- Refactor
ember-cli-clipboard to not depend on ember-arg-types anymore.
Describe the bug
ember-cli-clipboard cannot be used in an app build with Vite.
The following error is thrown:
The error is caused by
ember-get-config, which relies onrequirehere: https://github.com/mansona/ember-get-config/blob/552ce14df18a68481f4a8bb8528fa7b95e75b5e9/addon/index.js#L6ember-cli-clipboard pulls in ember-get-config through its dependency on ember-arg-type:
To Reproduce
I haven't tested this reproduction myself. But I assume it can be reproduced in any newly created app with Ember CLI v6.8 when adding ember-cli-clipboard to it.
Expected behavior
An app using ember-cli-clipboard can be built with Vite.
Additional context
I see 3 options:
ember-get-configto not rely onrequireanymore.ember-arg-typesto not depend onember-get-configanymore.ember-cli-clipboardto not depend onember-arg-typesanymore.