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

Cannot find module? #3082

Open
cecyLDY opened this issue Nov 19, 2024 · 6 comments
Open

Cannot find module? #3082

cecyLDY opened this issue Nov 19, 2024 · 6 comments
Assignees
Labels
development question Further information is requested wait for review

Comments

@cecyLDY
Copy link

cecyLDY commented Nov 19, 2024

When I added a plugin directory and recompiled, I got an error: error TS2307: Cannot find module '@cloudbeaver/plugin-new' or its corresponding type declarations.How to add a plugin directory to implement functions?

@cecyLDY cecyLDY added question Further information is requested wait for review labels Nov 19, 2024
@devnaumov
Copy link
Member

Hi @cecyLDY!

  1. Create a plugin-new folder inside the webapp/packages directory.
  2. Ensure the plugin structure is correct. You will need a manifest.ts file to define your plugin. Use an existing plugin as a reference to understand the structure, but remember to update the name in the package.json file to match your plugin's name.
  3. Implement the plugin logic. To handle tasks like registering buttons or panels, extend the Bootstrap class and implement the register method.
  4. Add your plugin to the product by locating the product-default folder and including your plugin in the index.ts file.
  5. Update the TypeScript references by running the "Update TS References CE" command from the workspace.
  6. Verify that the register method is triggered during the product's initialization. This confirms that your plugin is registered correctly.

If you have any further questions, feel free to ask

@cecyLDY
Copy link
Author

cecyLDY commented Nov 20, 2024

I have completed the first 4 steps, but the fifth step, Update TS References CE, is not a command. Executing the yarn run bundle command still produces an error message: Cannot find module '@ cloudbeamer/plugin new'. What should I do?

@devnaumov
Copy link
Member

devnaumov commented Nov 20, 2024

@cecyLDY Do you have a .vscode folder in your project? What code editor you using? If it’s VS Code, try this: Cmd + Shift + PTasks: Run Task or just run yarn run update-ts-references from webapp directory.

@cecyLDY
Copy link
Author

cecyLDY commented Nov 21, 2024

@devnaumov Thank you for your reply. I followed the above steps to add plugin new and executed yarn run update-ts- references. The information is as follows:
err1
err2

I don't know where else needs to be configured. If you have any ideas, please reply to me. Thank you

@devnaumov
Copy link
Member

Can you share a screenshot of your plugin structure and the package.json file?

@cecyLDY
Copy link
Author

cecyLDY commented Nov 22, 2024

plugin-new is a very simple structure, with the following structure and file content:
err3
err4
err5
err6
err7
err8
err9
err10
err11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development question Further information is requested wait for review
Projects
None yet
Development

No branches or pull requests

4 participants