asyncapi / html-template

HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.
63 stars 56 forks source link

can't build with Yarn 3 (pnp) in 1.0.0 #454

Open woylie opened 10 months ago

woylie commented 10 months ago

Describe the bug

After upgrading from 0.28.4 to 1.0.0, the asyncapi HTML documentation cannot be built with Yarn 3 in pnp mode anymore.

How to Reproduce

  1. yarn init -2
  2. add these lines to .yarnrc.yml:
nodeLinker: pnp
packageExtensions:
  "@asyncapi/parser@*":
    dependencies:
      "@stoplight/types": "^13.9.1"
      "@stoplight/json": "^3.20.2"
      "@stoplight/spectral-ref-resolver": "^1.0.3"
      "@stoplight/json-ref-readers": "^1.2.2"
  1. add these lines to package.json:
"scripts": {
    "asyncapi": "ag asyncapi.yml @asyncapi/html-template"
  },
  1. yarn add @asyncapi/generator @asyncapi/html-template
  2. save random asyncapi document as asyncapi.yml
asyncapi: 2.6.0
info:
  title: Hello world application
  version: "0.1.0"
channels:
  hello:
    publish:
      message:
        payload:
          type: string
          pattern: "^hello .+$"
  1. run yarn asyncapi

This will produce the following output:

Something went wrong:
Error: EROFS: read-only filesystem, mkdir '/node_modules/@asyncapi/html-template/__transpiled'
    at makeError$1 (/Users/me/project/assets/.pnp.cjs:14658:24)
    at EROFS (/Users/me/project/assets/.pnp.cjs:14685:10)
    at ZipFS.mkdirSync (/Users/me/project/assets/.pnp.cjs:16597:13)
    at ZipFS.mkdirpSync (/Users/me/project/assets/.pnp.cjs:14879:16)
    at ZipFS.mkdirSync (/Users/me/project/assets/.pnp.cjs:16595:19)
    at ZipFS.mkdirPromise (/Users/me/project/assets/.pnp.cjs:16591:17)
    at /Users/me/project/assets/.pnp.cjs:17658:26
    at /Users/me/project/assets/.pnp.cjs:17840:81
    at ZipOpenFS.getZipPromise (/Users/me/project/assets/.pnp.cjs:17947:22)
    at ZipOpenFS.makeCallPromise (/Users/me/project/assets/.pnp.cjs:17840:23)

Expected behavior

The documentation should still be built.

github-actions[bot] commented 10 months ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

woylie commented 9 months ago

The problem is still present in version 2.0.0.

derberg commented 8 months ago

@woylie I don't think it is related to yarn but rather how new HTML-template works. It uses new react engine for templating that requires TS transpilation of template on the fly before it is used in generation. Look like the environment where you have your html-template installed, do not allow storage of transpilation files on disk

woylie commented 8 months ago

@woylie I don't think it is related to yarn but rather how new HTML-template works. It uses new react engine for templating that requires TS transpilation of template on the fly before it is used in generation. Look like the environment where you have your html-template installed, do not allow storage of transpilation files on disk

* I suggest you switch from ag (Generator CLI) to AsyncAPI CLI (https://www.asyncapi.com/docs/tools/cli/usage#asyncapi-generate-fromtemplate-asyncapi-template)

* Make sure `/node_modules/@asyncapi/html-template` location is not read only

Thanks.

derberg commented 8 months ago

@woylie please run generation command with --debug flag and paste content here 🙏🏼

woylie commented 8 months ago

@woylie please run generation command with --debug flag and paste content here 🙏🏼

Forgot to mention, I did that, still no output.

derberg commented 8 months ago

can you see if latest html-template 2.0.0 also causes the same? 🙏

woylie commented 7 months ago

Yes, this is still an issue in @asyncapi/html-template 2.1.7 and @asyncapi/generator 1.17.5. @asyncapi/cli 1.5.2 still fails silently even with --debug flag.

derberg commented 5 months ago

@woylie https://github.com/asyncapi/html-template/issues/558 should have fix it for you, please try template 2.3.0

woylie commented 5 months ago

@derberg I just tried it, and I'm getting this output:

yarn ag ../asyncapi.yml -o output/ @asyncapi/html-template --debug
Template sources taken from /Users/me/project/assets/.yarn/cache/@asyncapi-html-template-npm-2.3.0-ce2a2154b3-64aaddc6e9.zip/node_modules/@asyncapi/html-template.
Version of used template is 2.3.0.
Something went wrong:
Error: EROFS: read-only filesystem, open '/node_modules/@asyncapi/html-template/__transpiled/index.html.js.map'
    at makeError$1 (/Users/me/project/assets/.pnp.cjs:14110:24)
    at EROFS (/Users/me/project/assets/.pnp.cjs:14137:10)
    at ZipFS.prepareWriteFile (/Users/me/project/assets/.pnp.cjs:19009:13)
    at ZipFS.writeFilePromise (/Users/me/project/assets/.pnp.cjs:18980:55)
    at /Users/me/project/assets/.pnp.cjs:16333:28
    at /Users/me/project/assets/.pnp.cjs:16561:87
    at ZipOpenFS.getMountPromise (/Users/me/project/assets/.pnp.cjs:16652:22)
    at ZipOpenFS.makeCallPromise (/Users/me/project/assets/.pnp.cjs:16561:23)
    at ZipOpenFS.writeFilePromise (/Users/me/project/assets/.pnp.cjs:16330:23)
    at VirtualFS.writeFilePromise (/Users/me/project/assets/.pnp.cjs:15342:24)

asyncapi still doesn't produce any output.

yarn asyncapi generate fromTemplate asyncapi.yml @asyncapi/html-template -o .

Versions:

derberg commented 5 months ago

oh damn

so good is that new error shows up

read-only filesystem, open

instead of

read-only filesystem, mkdir

there must be really some strict setup in your system, that even opening is blocked?

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: