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

[BUG] [CCI] Running yo-doc and yo-component scripts crashes with an error #598

Closed
andreymyssak opened this issue Mar 16, 2023 · 1 comment
Labels
bug Something isn't working CCI College Contributor Initiative

Comments

@andreymyssak
Copy link
Collaborator

Describe the bug

Running yo-doc and yo-component scripts crashes with the following error

$ yo ./generator-oui/app/documentation.js
internal/modules/cjs/loader.js:1131
      throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
      ^

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/trim-newlines/index.js
require() of ES modules is not supported.
require() of /Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/trim-newlines/index.js from /Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/meow/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/trim-newlines/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/trim-newlines/package.json.

    at new NodeError (internal/errors.js:322:7)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1131:13)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/Users/andreymyssak/Gomasko/Projects/opensearch/oui/node_modules/meow/index.js:8:20)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32) {
  code: 'ERR_REQUIRE_ESM'
}
error Command failed with exit code 1.

To Reproduce
Steps to reproduce the behavior:

  1. Open project
  2. Run yarn yo-doc or yarn yo-component
  3. See the error

Expected behavior
Generation of files according to scripts

Host/Environment (please complete the following information):

  • OS: macOS Ventura v13.2
  • Node v14.21.3
  • Yarn v1.22.19
@andreymyssak andreymyssak added bug Something isn't working untriaged labels Mar 16, 2023
@andreymyssak andreymyssak changed the title [BUG] [CCI] Running yo-doc' and yo-component' scripts crashes with an error [BUG] [CCI] Running yo-doc and yo-component scripts crashes with an error Mar 16, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Mar 16, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Mar 17, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Mar 17, 2023
andreymyssak added a commit to andreymyssak/oui that referenced this issue Mar 17, 2023
@BSFishy BSFishy removed the untriaged label Mar 21, 2023
ashwin-pc pushed a commit that referenced this issue Mar 22, 2023
opensearch-trigger-bot bot pushed a commit that referenced this issue Mar 22, 2023
Signed-off-by: Andrey Myssak <[email protected]>
(cherry picked from commit af9324a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Mar 22, 2023
Signed-off-by: Andrey Myssak <[email protected]>
(cherry picked from commit af9324a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@BSFishy
Copy link
Contributor

BSFishy commented Mar 22, 2023

PR has been merged into main 👍

@BSFishy BSFishy closed this as completed Mar 22, 2023
joshuarrrr pushed a commit that referenced this issue Mar 23, 2023
(cherry picked from commit af9324a)

Signed-off-by: Andrey Myssak <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
joshuarrrr added a commit that referenced this issue Mar 27, 2023
(cherry picked from commit af9324a)

Signed-off-by: Andrey Myssak <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Josh Romero <[email protected]>
@joshuarrrr joshuarrrr added the CCI College Contributor Initiative label Apr 13, 2023
@seanneumann seanneumann moved this to Done in Look & Feel May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CCI College Contributor Initiative
Projects
Status: Done
Development

No branches or pull requests

3 participants