dream-num / univer

Univer is an open-source alternative to Google Sheets, Slides, and Docs

Home Page:https://univer.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] The code just forked, the local package umd mode reference, cannot find UniverFacade after introduction, and the error "TypeError: Cannot read properties of undefined (reading 'FUniver')" is reported

feige-2011 opened this issue · comments

commented

在您提交此问题之前,您是否检查了以下内容?

  • 这真的是个问题吗?
  • 我已经在 Github Issues 中搜索过了,但没有找到类似的问题。

受影响的包和版本

0.1.14

复现链接

univer-test.zip
解压压缩包运行univer.html文件
Uploading 截屏2024-06-12 16.18.55.png…

预期行为

var univerAPI = UniverFacade.FUniver.newAPI(univer);

      univerAPI.onBeforeCommandExecute((command) => {
        const { id, type, params } = command;
        console.log(id);
        console.log(type);
        console.log(JSON.stringify(params));
        // 在命令执行前执行自定义逻辑
      });

      univerAPI.onCommandExecuted((command) => {
        const { id, type, params } = command;
        // 在命令执行后执行自定义逻辑
      });

能够找到UniverFacade 和调用UniverFacade.FUniver.newAPI(univer)方法

实际行为

"TypeError: Cannot read properties of undefined (reading 'FUniver')"

运行环境

Chrome

系统信息

System:
OS: macOS 14.0
CPU: (8) arm64 Apple M1
Memory: 40.02 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.6.0 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.13.2 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/npm
pnpm: 8.15.5 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/pnpm
Browsers:
Chrome: 116.0.5845.140
Safari: 17.0

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿

Origin Title: [Bug] 刚fork的代码,本地打包umd模式引用,引入后无法找到UniverFacade,报错"TypeError: Cannot read properties of undefined (reading 'FUniver')"

Title: [Bug] The code just forked, the local package umd mode reference, cannot find UniverFacade after introduction, and the error "TypeError: Cannot read properties of undefined (reading 'FUniver')" is reported


Before you submitted this question, did you check the following?

  • Is this really a problem?
  • I've searched Github Issues but haven't found any similar issues.

Affected packages and versions

0.1.14

Recurrence link

univer-test.zip
Unzip the compressed package and run the universal.html file
Uploading screenshot 2024-06-12 16.18.55.png…

Expected behavior

var univerAPI = UniverFacade.FUniver.newAPI(univer);

      univerAPI.onBeforeCommandExecute((command) => {
        const { id, type, params } = command;
        console.log(id);
        console.log(type);
        console.log(JSON.stringify(params));
        //Execute custom logic before command execution
      });

      univerAPI.onCommandExecuted((command) => {
        const { id, type, params } = command;
        //Execute custom logic after command execution
      });

Able to find UniverFacade and call UniverFacade.FUniver.newAPI(univer) method

Actual behavior

"TypeError: Cannot read properties of undefined (reading 'FUniver')"

Running environment

Chrome

system message

System:
OS: macOS 14.0
CPU: (8) arm64 Apple M1
Memory: 40.02 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.6.0 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.13.2 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/npm
pnpm: 8.15.5 - /opt/homebrew/Cellar/nvm/0.39.7/versions/node/v18.6.0/bin/pnpm
Browsers:
Chrome: 116.0.5845.140
Safari: 17.0

Known issue, please use v0.1.13. we will fix it in 0.1.15.