keycloakify / keycloakify

🔏 Keycloak theming for the modern web
https://www.keycloakify.dev
MIT License
1.51k stars 162 forks source link

build fails when using yarn plug n play #344

Closed robbert229 closed 7 months ago

robbert229 commented 1 year ago

Currently the keycloakify's build process involves making modifications to the node_modules folder, this results in it being incompatible with yarn's plug n play system. It would be a nice enhancement for keycloakify to function with yarn pnp.

...

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  yarn global add serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

🔏 Building the keycloak theme...⌚
/home/johnrowl/keycloakify-theme/.pnp.cjs:27853
  return Object.assign(new Error(`${code}: ${message}`), { code });
                       ^

Error: EROFS: read-only filesystem, mkdir '/node_modules/keycloakify/node_modules'
    at makeError$1 (/home/johnrowl/keycloakify-theme/.pnp.cjs:27853:24)
    at EROFS (/home/johnrowl/keycloakify-theme/.pnp.cjs:27880:10)
    at ZipFS.mkdirSync (/home/johnrowl/keycloakify-theme/.pnp.cjs:29792:13)
    at ZipFS.mkdirpSync (/home/johnrowl/keycloakify-theme/.pnp.cjs:28074:16)
    at ZipFS.mkdirSync (/home/johnrowl/keycloakify-theme/.pnp.cjs:29790:19)
    at ZipFS.mkdirPromise (/home/johnrowl/keycloakify-theme/.pnp.cjs:29786:17)
    at /home/johnrowl/keycloakify-theme/.pnp.cjs:30853:26
    at /home/johnrowl/keycloakify-theme/.pnp.cjs:31035:81
    at ZipOpenFS.getZipPromise (/home/johnrowl/keycloakify-theme/.pnp.cjs:31142:22)
    at ZipOpenFS.makeCallPromise (/home/johnrowl/keycloakify-theme/.pnp.cjs:31035:23) {
  code: 'EROFS'
}

Node.js v18.15.0
garronej commented 1 year ago

Thanks for the heads up.
We'll have a look to see how expensive it would be to support p&p

lordvlad commented 1 year ago

I think that is only the cache.

https://github.com/keycloakify/keycloakify/blob/0c65561bcbe1c5c05472d72a3f69773cd064bb45/src/bin/tools/downloadAndUnzip.ts#L104

You should be able to "fix" it by making sure that XDG_CACHE_HOME env var is set.

What OS are you on? Is the issue cropping up on a ci build?

On Thu, May 4, 2023, 19:22 Joseph Garrone @.***> wrote:

Thanks for the heads up. We'll have a look to see how expensive it would be to support p&p

— Reply to this email directly, view it on GitHub https://github.com/keycloakify/keycloakify/issues/344#issuecomment-1535139483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJJ2KHWFASODEZ3YW5SB3XEPQULANCNFSM6AAAAAAXUW3SSE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

myt588 commented 1 year ago

Wondering if there is any update on this issue. I'm using yarn pnp as well, and I got an error like following:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Minipass
    at Object.writeFile (node:fs:2168:5)
    at /Users/my-repo/.pnp.cjs:30057:21
    at new Promise (<anonymous>)
    at NodeFS.writeFilePromise (/Users/my-repo/.pnp.cjs:30052:18)
    at makeCallPromise.async.subPath.subPath (/Users/my-repo/.pnp.cjs:32305:32)
    at ZipOpenFS.makeCallPromise (/Users/my-repo/.pnp.cjs:32528:20)
    at ZipOpenFS.writeFilePromise (/Users/my-repo/.pnp.cjs:32304:23)
    at VirtualFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24)
    at PosixFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24)
    at NodePathFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Thanks

lordvlad commented 1 year ago

Have you tried my suggestion? Specifying XDG_CACHE_HOME?

@robbert229 @myt588 can you try runnning keycloakify while setting env XDG_CACHE_HOME=~/.cache?

On Thu, May 11, 2023, 03:53 Yetian @.***> wrote:

Wondering if there is any update on this issue. I'm using yarn pnp as well, and I got an error like following:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Minipass at Object.writeFile (node:fs:2168:5) at /Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:30057:21 at new Promise () at NodeFS.writeFilePromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:30052:18) at makeCallPromise.async.subPath.subPath (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:32305:32) at ZipOpenFS.makeCallPromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:32528:20) at ZipOpenFS.writeFilePromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:32304:23) at VirtualFS.writeFilePromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:31614:24) at PosixFS.writeFilePromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:31614:24) at NodePathFS.writeFilePromise (/Users/yetian.mao/Work/jcv-frontend-monorepo/.pnp.cjs:31614:24) { code: 'ERR_INVALID_ARG_TYPE' }

Thanks

— Reply to this email directly, view it on GitHub https://github.com/keycloakify/keycloakify/issues/344#issuecomment-1543174327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJJ2LVJADZPH37V4X45JDXFRBA5ANCNFSM6AAAAAAXUW3SSE . You are receiving this because you commented.Message ID: @.***>

myt588 commented 1 year ago

@lordvlad thanks for the suggestion.

Unfortunately, we tried the command with the env var, it still displays the same error. Our current workaround is to use npx to run the keycloakify command like the following:

npx keycloakify@6.13.2
pak-ferry commented 1 year ago

Hey there! Just wondering if there's any update on this issue? I have tried running keycloakify while setting env, but still no luck (Same error with @myt588), I really love this library a lot, many thanks!

Wondering if there is any update on this issue. I'm using yarn pnp as well, and I got an error like following:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Minipass
    at Object.writeFile (node:fs:2168:5)
    at /Users/my-repo/.pnp.cjs:30057:21
    at new Promise (<anonymous>)
    at NodeFS.writeFilePromise (/Users/my-repo/.pnp.cjs:30052:18)
    at makeCallPromise.async.subPath.subPath (/Users/my-repo/.pnp.cjs:32305:32)
    at ZipOpenFS.makeCallPromise (/Users/my-repo/.pnp.cjs:32528:20)
    at ZipOpenFS.writeFilePromise (/Users/my-repo/.pnp.cjs:32304:23)
    at VirtualFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24)
    at PosixFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24)
    at NodePathFS.writeFilePromise (/Users/my-repo/.pnp.cjs:31614:24) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Thanks

garronej commented 7 months ago

I think it shoud be fixed. Please reopen if it isn't