electron / electron/forge

When I modify the files in `app.aser.uppacked` dir, the file can't be loaded correctly

Open
#3,887 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [x] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Forge version

7.7.0

### Electron version

35.0.1

### Operating system

macOS , windows 11

### Last known working Forge version

_No response_

### Expected behavior

I pack my app with this config:
```js
packagerConfig: {
asar: {
unpack: ['**/assets/**/*.@(png|jpg)']
}
},
```

I want to modify some images in 'app.asar.unpacked` dir , then open the app , It could use the new images.

### Actual behavior

When I open the app , there is an error : `WebGL: INVALID_VALUE: texSubImage2D: bad image data`.
I the new image smaller (bytes, not size) than old, it could work , if bigger , The error will happen.

I see the image in devtool, it's not be loaded correctly.

If I don't use asar , everything is ok .

### Steps to reproduce

create a simple html page, it render a 3d object (with texture ) by webgl.

then pack it to an electron app by electron-forge, with :
```js
packagerConfig: {
asar: {
unpack: ['**/assets/**/*.@(png|jpg)']
}
},

```

then , change the 3d object's texture in 'app.asar.unpacked`, make the image is bigger .

The error will happen.

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.