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

在项目中webgpu项目(Orillusion),当调整canvas大小时,出现报错 #6900

Open
liujun3660105 opened this issue May 31, 2024 · 3 comments
Labels

Comments

@liujun3660105
Copy link

Describe the bug

当调整canvas尺寸时,报如下错误,
image
具体操作:
Uploading image.png…

Expected behavior

希望没有报错,能够正常显示

Actual behavior

No response

Version of ice.js

3.x

Content of build.json or ice.config.mts

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模式下,都没有问题

@ClarkXia
Copy link
Collaborator

具体操作图片有问题,可以直接提供下操作 canvas 的代码

@liujun3660105
Copy link
Author

具体操作图片有问题,可以直接提供下操作 canvas 的代码

没有代码,就是手动改变浏览器的窗口大小,进而canvas大小会自动变化

@ClarkXia
Copy link
Collaborator

提供下复现代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants