在项目中webgpu项目(Orillusion),当调整canvas大小时,出现报错
- Dominant language
- TypeScript
- Stars
- 18.6k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
当调整canvas尺寸时,报如下错误,
具体操作:
![Uploading image.png…]()
### Expected behavior
希望没有报错,能够正常显示
### Actual behavior
_No response_
### Version of ice.js
3.x
### Content of build.json or ice.config.mts
```TypeScript
import { defineConfig } from '@ice/app';
import request from '@ice/plugin-request';
import store from '@ice/plugin-store';
import auth from '@ice/plugin-auth';
// The project config, see https://v3.ice.work/docs/guide/basic/config
const minify = process.env.NODE_ENV === 'production' ? 'swc' : false;
export default defineConfig(() => ({
ssg: false,
minify,
plugins: [request(), store(), auth()],
compileDependencies: false,
devPublicPath: '/',
externals: {
l3d: 'L3d',
cesium: 'Cesium'
},
webpack: (config) => {
// Remove rule of .svg
config.module.rules = config.module.rules.filter((rule) => {
if (rule.test instanceof RegExp) {
return !rule.test.test('.svg');
}
return true;
});
// Add rule of .svg with @svgr/webpack
config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {}
}
]
});
return config;
}
// alias: {
// // eslint-disable-next-line quote-props
// 'l3d': path.resolve(__dirname, './public'),
// },
}));
```
### Additional context
我测试纯html和react-vite模式下,都没有问题
Contributor guide
Research direction
Start by reproducing the canvas-resize error in the Orillusion WebGPU project using the provided ice.config.mts configuration. Compare its behavior with the reported pure HTML and React-Vite cases, then use the error shown in the issue's screenshot to locate whether the problem is in the application or ice.js integration. Done means resizing the canvas displays normally without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript, webpack
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100