Skip to content
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

[dev-tool] error executing samples for ESM packages #29672

Open
jeremymeng opened this issue May 10, 2024 · 0 comments
Open

[dev-tool] error executing samples for ESM packages #29672

jeremymeng opened this issue May 10, 2024 · 0 comments
Labels
Client This issue points to a problem in the data-plane of the library. dev-tool Issues related to the Azure SDK for JS dev-tool needs-triage This is a new issue that needs to be triaged to the appropriate team.

Comments

@jeremymeng
Copy link
Contributor

https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3778146&view=logs&j=4eaf6b84-07d0-5e66-f484-4e9defa3fc2f&t=c0bbcefe-75de-57d8-29b4-466c419539c4 (MS INTERNAL)

Invoking "rushx execute:samples"

Found configuration in D:\a_work\1\s\rush.json

Rush Multi-Project Build Tool 5.120.6 - Node.js 18.20.2 (LTS)
"dev-tool samples run samples-dev"

[run-samples] Running D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts
[run-samples] Error in D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts:
[run-samples] Error: Must use import to load ES Module: D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts
require() of ES modules is not supported.
require() of D:\a_work\1\s\sdk\template\template\samples-dev\getConfigurationSetting.ts from D:\a_work\1\s\common\tools\dev-tool\src\commands\samples\run.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from D:\a_work\1\s\sdk\template\template\package.json.

[run-samples] Errors occurred in the following files:
[run-samples] - getConfigurationSetting.ts ( Error: Must use import to load ES Module: D:\a_work\1\s\sdk\template\template\samples-dev\getConfig )
[dev-tool] Errors occured. See the output above.
Error: Failed calling dev-tool samples run samples-dev. Exit code: 1
##[error]Cmd.exe exited with code '1'.
Finishing: Execute Samples

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. dev-tool Issues related to the Azure SDK for JS dev-tool Network - Private Link and removed Network - Private Link labels May 10, 2024
@github-actions github-actions bot added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. dev-tool Issues related to the Azure SDK for JS dev-tool needs-triage This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

1 participant