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

Generating outside a git repo always fails #465

Closed
fmvilas opened this issue Dec 11, 2023 · 2 comments
Closed

Generating outside a git repo always fails #465

fmvilas opened this issue Dec 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@fmvilas
Copy link
Member

fmvilas commented Dec 11, 2023

Describe the bug

I'm trying to generate HTML docs using the following command:

asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o docs --force-write

and it's giving me the following output:

Generation in progress. Keep calm and wait a bit... done

Generator Error: ENOTEMPTY: directory not empty, rename '/Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/typescript' -> '/Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/.typescript-4cSU71KO'

Even if I remove the docs directory, it still fails because (as I'm assuming) the CLI creates it before generation.

I noticed that running it on an existing folder with a Glee project, it's giving me another error:

Generation in progress. Keep calm and wait a bit... done

Generator Error: [BABEL]: Cannot find module '../lib/statuses'
Require stack:
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/feature.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/browserslist/node.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/browserslist/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/node_modules/@babel/helper-compilation-targets/lib/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/node_modules/@babel/preset-env/lib/debug.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/node_modules/@babel/preset-env/lib/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@babel/core/lib/config/files/module-types.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@babel/core/lib/config/files/configuration.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@babel/core/lib/config/files/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@babel/core/lib/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@rollup/plugin-babel/dist/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/lib/transpiler/transpiler.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/lib/transpiler/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/lib/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/renderer/react.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/lib/generator.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/lib/commands/generate/fromTemplate.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/module-loader.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/config/plugin.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/config/config.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/config/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/command.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@oclif/core/lib/index.js
- /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/bin/run (While processing: /Users/fmvilas/.nvm/versions/node/v19.6.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/generator-react-sdk/node_modules/@babel/preset-env/lib/index.js)

Expected behavior

It should generate the docs even without the --force-write flag.

@fmvilas fmvilas added the bug Something isn't working label Dec 11, 2023
@Souvikns
Copy link
Member

Even if I remove the docs directory, it still fails because (as I'm assuming) the CLI creates it before generation.

CLI is just calling the generator command, the folder is being created by the generator library. I ran the command on a glee application and it is working, though I still get some warnings

asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o docs --force-write 
[BABEL] Note: The code generator has deoptimised the styling of /Users/postman/.nvm/versions/node/v20.4.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/html-template/template/js/asyncapi-ui.min.js as it exceeds the max of 500KB.
Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <ul>. See https://reactjs.org/link/warning-keys for more information.
    at li
    at Sidebar (/Users/postman/.nvm/versions/node/v20.4.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/Sidebar/Sidebar.js:47:35)
    at div
    at section
    at AsyncApiLayout (/Users/postman/.nvm/versions/node/v20.4.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/Layout.js:40:23)
    at AsyncApiComponent (/Users/postman/.nvm/versions/node/v20.4.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/Standalone.js:99:28)
    at AsyncApiComponent (/Users/postman/.nvm/versions/node/v20.4.0/lib/node_modules/@asyncapi/cli/node_modules/@asyncapi/generator/node_modules/@asyncapi/react-component/lib/cjs/containers/AsyncApi/AsyncApi.js:87:28)
Generation in progress. Keep calm and wait a bit... done
Check out your shiny new generated files at docs.

@fmvilas
Copy link
Member Author

fmvilas commented Dec 14, 2023

Yeah, I can confirm it was my machine that was messed up. In any case, like you, I also see this warning and it's taking almost a minute to generate docs o.O

@fmvilas fmvilas closed this as completed Dec 14, 2023
@fmvilas fmvilas closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 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
Projects
None yet
Development

No branches or pull requests

2 participants