-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unpack Next.js cache dir or provide an option to choose the dir #3
Comments
@jamcalli for now I conclude that best option is to disable ASAR until either Next.js or Electron Builder fixes the issue...
asarUnpack:
- '.next/standalone/demo/.next/cache/**/*'
Made it work for monorepo, does not fix the problem... Electron still tries to write in ASAR instead of the unpacked dir. |
@kirill-konshin thanks for looking into this. It honestly isn't a big deal, and its probably totally ok to just opt out of image optimization caching, at least for my use case. I appreciate your suggestions, and documenting the nuances will be beneficial for anyone encountering similar situation. |
A true solution would be for next to allows specifying the cache dir. There are some tickets open regarding this, but obviously the use case is so niche that I cant see them working on it anytime soon. |
Btw, you can safely disable ASAR: it provides minimal security, primarily through obscurity. While it does package files into a single archive, the contents can be easily extracted, meaning it doesn’t actually encrypt or truly protect the files. This “security” mainly prevents casual users from easily browsing or modifying the app’s code but does little to deter a determined attacker. asar: false No issues with cache ;) |
This is true. asar just reduces the bundle size considerably (in my case almost 50% smaller), so it is ideal to use it. |
A follow up for #2 (comment)
Prod run emits errors:
There seems to be a bug in asarUnpack: electron-userland/electron-builder#7264
The following does not work in
demo
:Next.js does not seem to provide
cacheDir
setting: https://github.com/vercel/next.js/blob/canary/packages/next/src/server/image-optimizer.ts#L372Created vercel/next.js#72416
The text was updated successfully, but these errors were encountered: