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

can't build with Yarn 4 (pnp) in 3.0.0 #454

Closed
woylie opened this issue Oct 16, 2023 · 12 comments
Closed

can't build with Yarn 4 (pnp) in 3.0.0 #454

woylie opened this issue Oct 16, 2023 · 12 comments
Labels
bug Something isn't working stale

Comments

@woylie
Copy link

woylie commented Oct 16, 2023

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.

@woylie woylie added the bug Something isn't working label Oct 16, 2023
@github-actions
Copy link

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
Copy link
Author

woylie commented Dec 4, 2023

The problem is still present in version 2.0.0.

@derberg
Copy link
Member

derberg commented Dec 18, 2023

@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
Copy link
Author

woylie commented Dec 18, 2023

@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.

  • @asyncapi/cli 1.2.23 with @asyncapi/html-template 0.28.4 exits without output here for the same command.
  • I don't have a /node_modules folder on my system. Asyncapi is installed locally in a Yarn project with pnp mode.

@derberg
Copy link
Member

derberg commented Dec 19, 2023

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

@woylie
Copy link
Author

woylie commented Dec 19, 2023

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

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

Copy link
Member

derberg commented Dec 19, 2023

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

@woylie
Copy link
Author

woylie commented Feb 8, 2024

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
Copy link
Member

derberg commented Apr 2, 2024

@woylie #558 should have fix it for you, please try template 2.3.0

@woylie
Copy link
Author

woylie commented Apr 2, 2024

@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:

  • @asyncapi/cli: 1.7.3
  • @asyncapi/generator: 1.17.17
  • @asyncapi/html-template: 2.3.0
  • yarn 4.1.1

@derberg
Copy link
Member

derberg commented Apr 10, 2024

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?

Copy link

github-actions bot commented Aug 9, 2024

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

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 ❤️

@github-actions github-actions bot added the stale label Aug 9, 2024
@woylie woylie changed the title can't build with Yarn 3 (pnp) in 1.0.0 can't build with Yarn 4 (pnp) in 3.0.0 Oct 18, 2024
@woylie woylie closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants