# Troubleshooting

While running the B2B Platform build process, you may encounter environment-specific issues. Below are the most common errors and their solutions.

## ModuleNotFoundError: 'prosemirror' or 'TIPTAP'

&#x20;`[webpack-cli] ModuleNotFoundError: Error: Can't resolve 'prosemirror-keymap' ...`

This error typically occurs when certain peer dependencies required by the Tiptap editor are not correctly resolved during the automated build.

Manually install the missing Prosemirror modules within the core plugin directory:

1. Navigate to: `custom/plugins/b2bsellerscore/src/Resources/app/b2b_platform`
2. Run the following command:

   ```bash
   npm i prosemirror-schema-list prosemirror-history prosemirror-dropcursor prosemirror-gapcursor prosemirror-keymap prosemirror-commands
   ```

Alternative (Version Conflict): If the error persists, ensure you are using a compatible Node.js version. If using NVM, you can switch versions:

```bash
nvm install 16.15.1 && nvm use 16.15.1
```

## ReferenceError: B2bPlatform is not defined

`Uncaught ReferenceError: B2bPlatform is not defined`

This error appears in the browser console when the platform's core JavaScript assets failed to compile or were not correctly loaded.

Trigger a fresh build of the B2B assets to ensure the global `B2bPlatform` object is properly initialized and exported:

{% content-ref url="/pages/AHWxRuk4pZQmlHWY3CN7" %}
[Build the B2B Platform](/b2b-platform/developer-guide/cli-commands/development-commands/build-the-b2b-platform.md)
{% endcontent-ref %}

Conflict Check: If a rebuild does not resolve the issue, ensure that no third-party plugins or custom individualizations are interfering with the B2B platform. Common culprits include:

* HTML Minifiers: These can accidentally strip out essential script tags or corrupt the initialization logic.
* Security Headers/CSP: Overly restrictive Content Security Policies may block the execution of the B2B core.
* Optimization Plugins: Tools that defer or "lazy load" all JavaScript might prevent `B2bPlatform` from being available when the UI needs it.

## Webpack Permission Denied

`sh: 1: webpack: Permission denied`

This usually occurs due to restricted file permissions in the `node_modules` directory or an interrupted `npm install` process.

Reset the local Node environment within the plugin:

1. Navigate to `src/Resources/app/b2b_platform` inside the `b2bsellerscore` plugin.
2. Remove the existing lock file and modules:

   ```bash
   rm -rf package-lock.json node_modules
   ```
3. Reinstall dependencies:

   ```bash
   npm install
   ```
4. Return to the Shopware root and attempt the build again.

{% hint style="info" %}
Always ensure that your `npm` version is up to date and that the user executing the `bin/console` command has write permissions to the `custom/plugins` and `public/bundles` directories.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2b-sellers.com/b2b-platform/developer-guide/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
